Subversion Repositories Kolibri OS

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
9896 akron1 1
(*
2
    Copyright 2016, 2022 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 .
16
*)
17
 
18
MODULE ColorDlg;
19
 
20
IMPORT sys := SYSTEM, KOSAPI;
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
PROCEDURE Show*(cd: Dialog);
49
BEGIN
50
  IF cd # NIL THEN
51
    cd.X := 0;
52
    cd.Y := 0;
53
    ColorDialog_start(cd)
54
  END
55
END Show;
56
 
57
PROCEDURE Create*(draw_window: DRAW_WINDOW): Dialog;
58
VAR res: Dialog;
59
BEGIN
60
  NEW(res);
61
  IF res # NIL THEN
62
    res.s_com_area_name := "FFFFFFFF_color_dlg";
63
    res.com_area := 0;
64
    res.type := 0;
65
    res.color_type := 0;
66
    res.procinfo := sys.ADR(res.procinf[0]);
67
    res.com_area_name := sys.ADR(res.s_com_area_name[0]);
68
    res.start_path := sys.SADR("/sys/colrdial");
69
    res.draw_window := draw_window;
70
    res.status := 0;
71
    res.X := 0;
72
    res.Y := 0;
73
    res.color := 0;
74
    ColorDialog_init(res)
75
  END
76
  RETURN res
77
END Create;
78
 
79
PROCEDURE Destroy*(VAR cd: Dialog);
80
BEGIN
81
  IF cd # NIL THEN
82
    DISPOSE(cd)
83
  END
84
END Destroy;
85
 
86
 
87
END ColorDlg.