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

   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\tabitem.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.tabpage 24.07.07 0.0.A.
 11 *
 12 * Author: Alexander Krivonogov ( gentee )
 13 *
 14 ******************************************************************************/
 15 
 16 
 17 
 18 /*------------------------------------------------------------------------------
 19    Internal Methods
 20 */
 21 /*Метод vTabItem.iUpdate()
 22 Обновить оконное представление
 23 */
 24 method vTabItem.iUpdate()
 25 {
 26    TCITEM tci
 27    tci.mask = $TCIF_TEXT
 28    /* | $TCIF_PARAM
 29    tci.lParam = &this*/
 30    tci.pszText = this.pCaption.Text(this).ptr()         
 31    .Owner->vTab.WinMsg( $TCM_SETITEMW, .pWinIndex, &tci )
 32 }
 33 
 34 /*------------------------------------------------------------------------------
 35    Properties
 36 */
 37 /* Свойство ustr Caption - Get Set
 38 Устанавливает или получает заголовок закладки
 39 */
 40 property locustr vTabItem.Caption <result>
 41 {
 42    result = .pCaption.Value
 43 }
 44 
 45 property vTabItem.Caption( ustr val )
 46 {   
 47    .pCaption.Value = val
 48    .iUpdate()       
 49 }
 50 
 51 
 52 /* Свойство uint Index - Get Set
 53 Устанавливает или получает индекс закладки
 54 */
 55 property uint vTabItem.Index
 56 {
 57    return this.TabOrder  
 58 }
 59 
 60 property vTabItem.Index( uint val )
 61 {           
 62    if this.Owner && this.Owner->vCtrl.TypeIs( vTab )
 63    {
 64       if .cidx != val
 65       {
 66          uint i         
 67          //uint curenabled = .pEnabled
 68          //this.Enabled = 0
 69          this.TabOrder = val
 70          //this.Enabled = 1
 71          this.mSetEnabled()      
 72          this.iUpdate()
 73          uint ctrls as this.Owner->vCtrl.Comps//ctrls    
 74          fornum i, this.Owner->vCtrl.pCtrls/**ctrls*/
 75          {
 76             if ctrls[i]->vCtrl.Visible : break
 77          }
 78          
 79          this.Owner->vTab.CurIndex = i
 80       }      
 81    }      
 82 }
 83 
 84 
 85 /*------------------------------------------------------------------------------
 86    Virtual Methods
 87 */
 88 
 89 method vTabItem vTabItem.mCreateWin <alias=vTabItem_mCreateWin>()
 90 {
 91    //getch()
 92    this.CreateWin( /*"GVTransparent".ustr()*//*"Static".ustr()/*"#32770".ustr()*/ "GVForm".ustr(), /*0x00010400*/0, /*$WS_VISIBLE |*/
 93                      /*0x50000000/*0x50010444*/$WS_CHILD | $WS_CLIPSIBLINGS | $WS_CLIPCHILDREN )   
 94    this.prevwndproc = -1
 95    this->vCtrl.mCreateWin()   
 96    //setxpstyle( this.hwnd )
 97    //SendMessage( this.hwnd, $WM_SETFONT, GetStockObject( $DEFAULT_GUI_FONT ),0 )      
 98 //   setxpstyle( this.hwnd )
 99    //ShowWindow( this.hwnd, 1)
100    return this
101 }
102 
103 method uint vTabItem.mPosChanging <alias=vTabItem_mPosChanging>( evparEvent ev )
104 {  
105    //this->vCtrl.mPosChanging( ev )         
106    if this.Owner.TypeIs( vTab )
107    {           
108       uint evp as ev->eventpos         
109       evp.loc = this.Owner->vTab.pAdjLoc                     
110       if evp.move //&& evp.loc != this.loc
111       {
112          this.onposchanging.run( evp )            
113          SetWindowPos( this.hwnd, 0, 
114                evp.loc.left, evp.loc.top, evp.loc.width, evp.loc.height, 
115                $SWP_NOACTIVATE | $SWP_NOZORDER )            
116          RedrawWindow( this.hwnd, 0->RECT, 0, 0x507)
117       }
118    }
119    
120    return 0        
121 }
122 
123 method vTabItem.mSetVisible <alias=vTabItem_mSetVisible>( )
124 {
125    ShowWindow( this.hwnd, ?( this.pVisible, $SW_SHOWNOACTIVATE, $SW_HIDE ))
126 }
127 
128 method vTabItem.mSetEnabled <alias=vTabItem_mSetEnabled>( )
129 {
130    uint i
131    /*if .pEnabled != val
132    {*/
133       if !.pEnabled
134       {
135          .Owner->vCtrl.WinMsg( $TCM_DELETEITEM, .pWinIndex )
136          fornum i = .cidx + 1, this.Owner->vCtrl.pCtrls/**(this.Owner->vCtrl.ctrls)*/
137          {
138             uint item as .Owner->vCtrl./*ctrls*/Comps[i]->vTabItem
139             if item.Enabled 
140             {
141                item.pWinIndex--
142             }
143          }
144          .pWinIndex = -1
145          if .Owner->vTab.CurIndex == .cidx 
146          {           
147             .Owner->vTab.CurIndex = .cidx - 1            
148          }
149       }
150       else
151       {      
152          TCITEM tci
153          uint i, winindex         
154          fornum i = 0, .cidx
155          {
156             uint item as .Owner->vCtrl./*ctrls*/Comps[i]->vTabItem            
157             if item.Enabled
158             {
159                winindex++
160             }
161          }
162          .pWinIndex = winindex
163          fornum i = .cidx + 1, this.Owner->vCtrl.pCtrls/**(this.Owner->vCtrl.ctrls)*/
164          {
165             uint item as .Owner->vCtrl./*ctrls*/Comps[i]->vTabItem
166             if item.Enabled 
167             {
168                item.pWinIndex++
169             }
170          }
171          /*tci.mask = $TCIF_PARAM
172          tci.lParam = &this
173          print( "param1 = \(tci.lParam)\n" )*/
174          .Owner->vCtrl.WinMsg( $TCM_INSERTITEMW, .pWinIndex, &tci )
175          .iUpdate()
176          if .Owner->vTab.CurIndex == -1
177          {
178             .Owner->vTab.CurIndex = 0  
179          }
180       }
181       //this->vCtrl.mSetEnabled()
182       .Owner->vTab.iCalcAdj()
183    //}
184 }
185 
186 /*Виртуальный метод uint vTabItem.mLangChanged - Изменение текущего языка
187 */
188 method vTabItem.mLangChanged <alias=vTabItem_mLangChanged>()
189 {   
190    .iUpdate()
191    this->vCtrl.mLangChanged()  
192 }
193 /*method vTabItem.mSetOwner <alias = vTabItem_mSetOwner> ( vComp newowner )
194 {   
195    if newowner && newowner.TypeIs( vTab )
196    {
197       this->vCtrl.mSetOwner( newowner )  
198       TCITEM tci               
199       .Owner->vTab.WinMsg( $TCM_INSERTITEMW, 0, &tci )
200       .Owner->vTab.iCalcAdj()
201       .iUpdate()    
202       eventpos evp
203       evp.code = $e_poschanging 
204       evp.move = 1
205       .Virtual( $mPosChanging, &evp )            
206    } 
207    else
208    {
209       .pOwner = 0
210    }
211 }*/
212 
213 /*------------------------------------------------------------------------------
214    Registration
215 */
216 method vTabItem vTabItem.init( )
217 {    
218    this.pTypeId = vTabItem
219    
220    this.pCanContain = 1
221    this.pVisible = 0
222    ///this.pEnabled = 0
223    this.flgXPStyle = 1
224    
225    /*WNDCLASSEX visclass
226    ustr classname = "GVTransparent"   
227    with visclass
228    {
229       .cbSize      = sizeof( WNDCLASSEX )
230       //.style       = $CS_HREDRAW | $CS_VREDRAW
231       .lpfnWndProc = callback( &myproc, 4 )
232       .cbClsExtra  = 0
233       .cbWndExtra  = 0
234       .hInstance   = GetModuleHandle( 0 )
235       .hIcon       = 0
236       .hCursor     = LoadCursor( 0, $IDC_ARROW )
237       .hbrBackground = 16
238       .lpszMenuName  = 0
239       .lpszClassName = classname.ptr()
240       .hIconSm     = 0
241    }
242    uint hclass = RegisterClassEx( &visclass )*/ 
243    return this 
244 }  
245 
246 /*method vTabItem.getprops( uint typeid, compMan cm )
247 {
248    this->vCtrl.getprops( typeid, cm)
249    cm.addprops( typeid, 
250 %{ "caption"     , str, 0})                         
251 }*/
252 /*
253 method vTabItem.getevents()
254 {
255    %{"onclick"}
256 }
257 */
258 
259 func init_vTabItem <entry>()
260 {
261    regcomp( vTabItem, "vTabItem", vCtrl, $vCtrl_last,
262       %{ %{$mCreateWin,    vTabItem_mCreateWin },
263          %{$mPosChanging,  vTabItem_mPosChanging },
264          %{$mSetEnabled,   vTabItem_mSetEnabled },
265          %{$mSetVisible,   vTabItem_mSetVisible },
266          %{$mLangChanged,  vTabItem_mLangChanged }
267       },
268       /*%{
269       //%{$WM_CTLCOLORBTN, vTabItem_wmclcolorbtn },
270       %{$WM_CTLCOLORSTATIC, vTabItem_wmclcolorbtn },
271       %{$WM_ERASEBKGND, vTabItem_wmerasebkgnd }}*/
272       0->collection )
273 } 
Edit