EnglishРусский  

   ..

   addustr.g

   app.g

   btn.g

   btnpic.g

   comp.g

   ctrl.g

   dialogs.g

   edit.g

   events.g

   fonts.g

   form.g

   gray.g

   grey.g

   images.g

   label.g

   labeled.g

   locustr.g

   menu.g

   panel.g

   picture.g

   s.txt

   styles.g

   tab.g

   tabitem.g

   tabpage.g

   toolbar.g

   tray.g

   url.g

   virtctrl.g

   vis.g

   viswin.g

Ads

Perfect Automation tool
All-In-One: Script editor, Launcher, Scheduler, Keyboard & Mouse Recorder. Try now!

CreateInstall
Freeware and commercial installers.

Cell Phone Batteries
Batteries Plus offers batteries for laptop, camcorder, cell phone, camera.

Gentee needs your help!
How to advertise with us
 
laptop battery

source\lib\vis\virtctrl.g
  1 /******************************************************************************
  2 *
  3 * Copyright (C) 2004-2007, The Gentee Group. All rights reserved. 
  4 * This file is part of the Gentee open source project - http://www.gentee.com. 
  5 * 
  6 * THIS FILE IS PROVIDED UNDER THE TERMS OF THE GENTEE LICENSE ("AGREEMENT"). 
  7 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE CONSTITUTES RECIPIENTS 
  8 * ACCEPTANCE OF THE AGREEMENT.
  9 *
 10 * ID: vis.virtctrl 02.04.08 0.0.A.
 11 *
 12 * Author: Alexander Krivonogov ( gentee )
 13 *
 14 ******************************************************************************/
 15 /* Компонента vVirtCtrl, порождена от vComp
 16 Виртуальный элемент управления (не имеет своего окна)
 17 События
 18    
 19 */
 20 
 21 include
 22 {   
 23    "comp.g"
 24 }
 25 
 26 operator vloc =( vloc l, r )
 27 {
 28    mcopy( &l, &r, sizeof(vloc) )
 29    return l
 30 }
 31 
 32 operator uint ==( vloc l, r )
 33 {
 34    return l.left == r.left && l.top == r.top && l.width == r.width && l.height == r.height
 35 }
 36 
 37 type vVirtCtrl <inherit = vComp>
 38 {
 39 //Hidden Fields
 40    vloc    loc
 41    uint    pVisible
 42    uint    pEnabled
 43    locustr pHint
 44    
 45    uint cidx  //Индекс контрола 
 46 }
 47 
 48 define {
 49    mPosChanging = $vComp_last
 50    mChildPosChanged
 51    mPosUpdate   
 52    mCreateWin
 53 
 54    mSetEnabled
 55    mSetVisible
 56    mSetHint
 57    mSetCaption
 58    
 59 
 60    
 61    vVirtCtrl_last
 62 }
 63 /*------------------------------------------------------------------------------
 64    Propirties
 65 */
 66 
 67 property int vVirtCtrl.Left
 68 {   
 69    .Virtual( $mPosUpdate )
 70    return this.loc.left
 71 }
 72 
 73 property vVirtCtrl.Left( int val )
 74 {  
 75    if val != this.loc.left
 76    {      
 77       eventpos ep
 78       this.loc.left = val
 79       ep.loc = this.loc
 80       ep.loc.left = val
 81       ep.move = 1
 82       ep.code = $e_poschanging      
 83       .Virtual( $mPosChanging, ep )    
 84    } 
 85 }
 86 
 87 property int vVirtCtrl.Top
 88 {
 89    .Virtual( $mPosUpdate )
 90    return this.loc.top
 91 }
 92 
 93 property vVirtCtrl.Top( int val )
 94 {   
 95    if val != this.loc.top
 96    {
 97       eventpos ep
 98       this.loc.top = val
 99       ep.loc = this.loc
100       ep.loc.top = val
101       ep.move = 1
102       ep.code = $e_poschanging
103       .Virtual( $mPosChanging, ep )
104    }
105 }
106 
107 property int vVirtCtrl.Width
108 {
109    .Virtual( $mPosUpdate )
110    return this.loc.width
111 }
112 
113 property vVirtCtrl.Width( int val )
114 {
115    if val < 0 : val = 0   
116    if val != this.loc.width
117    {   
118       eventpos ep      
119       ep.loc = this.loc
120       ep.loc.width = val
121       ep.move = 1
122       ep.code = $e_poschanging         
123       .Virtual( $mPosChanging, ep )    
124    }
125 }
126 
127 property int vVirtCtrl.Height
128 {
129    .Virtual( $mPosUpdate )
130    return this.loc.height
131 }
132 
133 
134 property vVirtCtrl.Height( int val )
135 {
136    if val < 0 : val = 0
137    if val != this.loc.height
138    {      
139       eventpos ep
140       ep.loc = this.loc
141       ep.loc.height = val
142       ep.move = 1
143       ep.code = $e_poschanging      
144       .Virtual( $mPosChanging, ep )       
145    } 
146 }
147 
148 /* Свойство uint Visible - Get Set
149 Видимость элемента управления
150 */
151 property vVirtCtrl.Visible( uint val )
152 {   
153    if val != this.pVisible
154    {   
155       this.pVisible = val
156       .Virtual( $mSetVisible )
157       if &this.Owner()
158       {
159          this.Owner->vVirtCtrl.Virtual( $mChildPosChanged, 0 )
160       }
161    }
162 }
163 
164 property uint vVirtCtrl.Visible
165 {
166    return this.pVisible
167 }
168 
169 
170 /* Свойство uint Visible - Get Set
171 Доступность элемента управления
172 */
173 property vVirtCtrl.Enabled( uint val )
174 {
175    if val != this.pEnabled
176    {
177       this.pEnabled = val
178       .Virtual( $mSetEnabled )           
179    }
180 }
181 
182 property uint vVirtCtrl.Enabled
183 {
184    return this.pEnabled
185 }
186 
187 
188 /* Свойство ustr vVirtCtrl.Hint - Get Set
189 Всплывающая подсказка
190 */
191 property ustr vVirtCtrl.Hint <result>
192 {
193    result = this.pHint.Value
194 }
195 
196 property vVirtCtrl.Hint( ustr val )
197 {  
198    if val != this.pHint.Value
199    { 
200       this.pHint.Value = val
201       .Virtual( $mSetHint )
202    }         
203 }
204 
205 
206 /*Виртуальный метод uint vCustomBtn.mLangChanged - Изменение текущего языка
207 */
208 method vVirtCtrl.mLangChanged <alias=vVirtCtrl_mLangChanged>()
209 {
210    .Virtual( $mSetHint ) 
211    this->vComp.mLangChanged() 
212 }
213 
214 /*------------------------------------------------------------------------------
215    Registration
216 */
217 
218 
219 method vVirtCtrl vVirtCtrl.init()
220 {
221    this.pTypeId = vVirtCtrl
222    this.pVisible = 1
223    this.pEnabled = 1
224    return this
225 }
226 
227 func init_vVirtCtrl <entry>()
228 {
229    regcomp( vVirtCtrl, "vVirtCtrl", vComp, $vVirtCtrl_last,
230        %{ %{$mLangChanged,  vVirtCtrl_mLangChanged } },
231       0->collection )
232       
233 ifdef $DESIGNING {   
234       
235    cm.AddComp( vVirtCtrl )
236    
237    cm.AddProps( vVirtCtrl,  %{ 
238 "Visible"  , uint, 0,//$PROP_LOADAFTERCHILD,
239 "Enabled"  , uint, 0,
240 "Hint"     , ustr, 0
241 })      
242                                                    
243 }
244  //print( "reg vform 2\n" )         
245 }
Edit