Subversion Repositories Kolibri OS

Rev

Rev 9896 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

  1. (*
  2.     Copyright 2016, 2022, 2023 Anton Krotov
  3.  
  4.     This program is free software: you can redistribute it and/or modify
  5.     it under the terms of the GNU Lesser General Public License as published by
  6.     the Free Software Foundation, either version 3 of the License, or
  7.     (at your option) any later version.
  8.  
  9.     This program is distributed in the hope that it will be useful,
  10.     but WITHOUT ANY WARRANTY; without even the implied warranty of
  11.     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  12.     GNU Lesser General Public License for more details.
  13.  
  14.     You should have received a copy of the GNU Lesser General Public License
  15.     along with this program.  If not, see <http://www.gnu.org/licenses/>.
  16. *)
  17.  
  18. MODULE ColorDlg;
  19.  
  20. IMPORT SYSTEM;
  21.  
  22. TYPE
  23.  
  24.         DRAW_WINDOW = PROCEDURE;
  25.  
  26.         TDialog = RECORD
  27.                 type,
  28.                 procinfo,
  29.                 com_area_name,
  30.                 com_area,
  31.                 start_path: INTEGER;
  32.                 draw_window: DRAW_WINDOW;
  33.                 status*,
  34.                 X, Y,
  35.                 color_type,
  36.                 color*: INTEGER;
  37.  
  38.                 procinf: ARRAY 1024 OF CHAR;
  39.                 s_com_area_name: ARRAY 32 OF CHAR
  40.         END;
  41.  
  42.         Dialog* = POINTER TO TDialog;
  43.  
  44.  
  45. PROCEDURE [stdcall, "Proc_lib.obj", ""] ColorDialog_start (cd: Dialog); END;
  46. PROCEDURE [stdcall, "Proc_lib.obj", ""] ColorDialog_init (cd: Dialog); END;
  47.  
  48.  
  49. PROCEDURE Show* (cd: Dialog);
  50. BEGIN
  51.         IF cd # NIL THEN
  52.                 cd.X := 0;
  53.                 cd.Y := 0;
  54.                 ColorDialog_start(cd)
  55.         END
  56. END Show;
  57.  
  58.  
  59. PROCEDURE Create* (draw_window: DRAW_WINDOW): Dialog;
  60. VAR
  61.         res: Dialog;
  62. BEGIN
  63.         NEW(res);
  64.         IF res # NIL THEN
  65.                 res.s_com_area_name := "FFFFFFFF_color_dlg";
  66.                 res.com_area := 0;
  67.                 res.type := 0;
  68.                 res.color_type := 0;
  69.                 res.procinfo := SYSTEM.ADR(res.procinf[0]);
  70.                 res.com_area_name := SYSTEM.ADR(res.s_com_area_name[0]);
  71.                 res.start_path := SYSTEM.SADR("/sys/colrdial");
  72.                 res.draw_window := draw_window;
  73.                 res.status := 0;
  74.                 res.X := 0;
  75.                 res.Y := 0;
  76.                 res.color := 0;
  77.                 ColorDialog_init(res)
  78.         END
  79.         RETURN res
  80. END Create;
  81.  
  82.  
  83. PROCEDURE Destroy* (VAR cd: Dialog);
  84. BEGIN
  85.         IF cd # NIL THEN
  86.                 DISPOSE(cd)
  87.         END
  88. END Destroy;
  89.  
  90.  
  91. END ColorDlg.
  92.