Correction of unstable testing cases
[occt.git] / src / WNT / WNT_IconBox.cdl
1 -- Created on: 1996-01-29
2 -- Created by: PLOTNIKOV Eugeny
3 -- Copyright (c) 1996-1999 Matra Datavision
4 -- Copyright (c) 1999-2012 OPEN CASCADE SAS
5 --
6 -- The content of this file is subject to the Open CASCADE Technology Public
7 -- License Version 6.5 (the "License"). You may not use the content of this file
8 -- except in compliance with the License. Please obtain a copy of the License
9 -- at http://www.opencascade.org and read it completely before using this file.
10 --
11 -- The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
12 -- main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
13 --
14 -- The Original Code and all software distributed under the License is
15 -- distributed on an "AS IS" basis, without warranty of any kind, and the
16 -- Initial Developer hereby disclaims all such warranties, including without
17 -- limitation, any warranties of merchantability, fitness for a particular
18 -- purpose or non-infringement. Please see the License for the specific terms
19 -- and conditions governing the rights and limitations under the License.
20
21
22
23 class IconBox from WNT inherits Window from WNT
24
25         ---Purpose: This class defines a Windows NT icon box
26
27  uses
28
29     Handle        from Aspect,
30     GraphicDevice from WNT,
31     WClass        from WNT,
32     Window        from WNT,
33     Uint          from WNT,
34     Long          from WNT,
35     Dword         from WNT,
36     NameOfColor   from Quantity
37
38  raises
39
40     WindowDefinitionError from Aspect,
41     WindowError           from Aspect
42
43  is
44
45     Create (
46      aDevice  : GraphicDevice from WNT;
47      aName    : CString       from Standard;
48      aStyle   : Dword         from WNT = 0;
49      Xc       : Real          from Standard = 0.5;
50      Yc       : Real          from Standard = 0.5;
51      aBkColor : NameOfColor   from Quantity = Quantity_NOC_MATRAGRAY
52     )
53      returns mutable IconBox from WNT
54         ---Level:   Public
55         ---Purpose: Creates an IconBox defined by his Center in DSU.
56         --          ALL Icons are loaded from the Icon File Directory Name:
57         --          "[$SYMBOL]xxxxxxx[.ifd]"
58         --  Warning: Raises if the Position is out of the Screen Space
59         --          or the Icon File Directory Name don't exist
60      raises WindowDefinitionError from Aspect;
61
62
63         ---------------------------------------------------
64         -- Category: Methods to modify the class definition
65         ---------------------------------------------------
66
67
68     LoadIcons ( me : mutable; Name : CString from Standard ) 
69      returns Integer from Standard is static;
70         ---Level:   Public
71         ---Purpose: Loads Icon Box from an Other Icon File Directory Name
72         --          and returns the loaded icons number.
73         --  Warning: The Icons previously loaded are NOT cleared.
74
75     Show ( me ) is static;
76         ---Level:   Public
77         ---Purpose: Shows Icon Box to the screen
78         --  Warning: The Icon Box is displayed at the centered position
79         --          specified at the creation time and the size depend
80         --          of the Icon number really loaded inside.
81
82     UnloadIcons (
83      me   : mutable;
84      Name : CString from Standard
85     ) 
86      returns Integer from Standard is static;
87         ---Level:   Public
88         ---Purpose: Unloads All previously loaded Icons in the IconBox
89         --          and returns the unloaded icons number.
90
91     Destroy ( me : mutable ) is redefined;
92         ---Level:   Public
93         ---Purpose: Destroies the IconBox
94         ---C++: alias ~
95
96     AddIcon (
97      me      : mutable;
98      W       : Window  from WNT;
99      Name    : CString from Standard;
100      aWidth  : Integer from Standard = 0;
101      aHeight : Integer from Standard = 0
102     ) is static;
103         ---Level: Public
104         ---Purpose: Adds an Icon of Size aWidth,aHeight given in PIXEL
105         --          to the Icon Box from a FULL Existing Window
106         --  NOTE that if aWidth or aHeight is 0 the default icon size is taken.
107
108     SaveIcons ( me ) returns Integer from Standard is static;
109         ---Level: Public
110         ---Purpose:  Save all new created Icons as iconname.xwd file in the user
111         --      directory and returns the saved icons number.
112
113     SetDim (
114      me      : mutable;
115      aWidth  : Integer from Standard;
116      aHeight : Integer from Standard
117     ) is static;
118         ---Level:   Public
119         ---Purpose: Sets dimensions for icons which are visible in the box.
120
121         ----------------------------
122         -- Category: Inquire methods
123         ----------------------------
124
125
126     IconNumber ( me )
127      returns Integer from Standard is static;
128         ---Level:   Public
129         ---Purpose: Returns the Number of Icons loaded in the Icon Box.
130
131     IconName ( me; Index : Integer from Standard )
132      returns CString from Standard
133         ---Level:   Public
134         ---Purpose: Returns the Name of the N ime Icon
135         --  Warning: Raises if Index if out of range depending of the
136         --          Number of Loaded Icons.
137      raises WindowError from Aspect is static;
138
139     IconSize (
140      me;
141      Name          : CString     from Standard;
142      Width, Height : out Integer from Standard
143     )
144      returns Boolean from Standard is static;
145         ---Level:   Public
146         ---Purpose: Returns the Pixmap Size attached to the Icon Name
147         --  Warning: May return FALSE if Icon doesn't exist in the IconBox.
148         ---Category: Inquire methods
149
150     IconPixmap ( me; Name : CString from Standard )
151      returns Handle from Aspect is static;
152         ---Level:   Public
153         ---Purpose: Returns the Pixmap attached to the Icon Name
154         --  Warning: May return 0 if Icon doesn't exist in the IconBox.
155
156     IconPixmap (
157      me;
158      Name   : CString from Standard;
159      Width  : Integer from Standard;
160      Height : Integer from Standard
161     ) returns Handle from Aspect is static;
162         ---Level:   Public
163         ---Purpose: Returns the Centered part of the Pixmap of required Size
164         --          attached to the Icon Name
165         --  Warning: May return 0 if Icon doesn't exist in the IconBox.
166
167     HandleEvent (
168      me     : mutable;
169      hwnd   : Handle from Aspect;
170      uMsg   : Uint   from WNT;
171      wParam : Dword  from WNT;
172      lParam : Dword  from WNT
173     )
174      returns Long from WNT is static;
175         ---Level:   Internal
176         ---Purpose: routine to process events sent to the icon box
177  fields
178  
179     myIconWidth  : Integer from Standard is protected;
180     myIconHeight : Integer from Standard is protected;
181     myFont       : Handle  from Aspect   is protected;
182     myPen        : Handle  from Aspect   is protected;
183
184 --  fields for event management
185
186     myDragging   : Boolean from Standard is protected;
187     myStart,
188     myIncX,
189     myIncY,
190     myNX,
191     myNY,
192     myNPos,
193     myMaxPos     : Integer from Standard is protected;
194
195 end IconBox;