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 define {
17 //TCM_FIRST 0x1300
18 //TCM_INSERTITEMA = 0x1307 // (TCM_FIRST + 7)
19 //TCM_INSERTITEMW = 0x133E // (TCM_FIRST + 62)
20 }
21
22 type vTabPage <inherit = vCtrl>
23 {
24 locustr pCaption
25 uint pPageIdx
26 // onevent onclick
27 }
28
29 /*------------------------------------------------------------------------------
30 Internal methods
31 */
32 method vTabPage.iUpdate()
33 {
34 if this.pOwner
35 {
36 eventuint eu
37 eu.code = $e_update
38 eu.val = &this
39 //this.p_owner->vCtrl.event(eu)
40 }
41 }
42
43
44 /*------------------------------------------------------------------------------
45 Properties
46 */
47 /* Свойство ustr Caption - Get Set
48 Устанавливает или получает заголовок закладки
49 */
50 property ustr vTabPage.Caption <result>
51 {
52 result = .pCaption.Value
53 }
54
55 property vTabPage.Caption( ustr val )
56 {
57 .pCaption.Value = val
58 .iUpdate()
59 }
60
61 property uint vTabPage.Index
62 {
63 return this.TabOrder
64 }
65
66 property vTabPage.Index( uint val )
67 {
68 if this.Owner && this.Owner->vCtrl.TypeIs( vTab )
69 {
70 uint i
71 this.TabOrder = val
72 this.iUpdate()
73 uint ctrls as this.Owner->vCtrl.ctrls
74 fornum i, *ctrls
75 {
76 if ctrls[i]->vCtrl.Visible : break
77 }
78 this.Owner->vTab.CurPage = i
79 }
80 }
81 /*
82 method uint vTabPage.defproc( eventn ev )
83 {
84 switch ev.code
85 {
86 case $e_poschanging
87 {
88 if this.owner.typeis( vtab )
89 {
90 uint evp as ev->eventpos
91 evp.loc = this.owner->vtab.adjloc
92 if evp.move //&& evp.loc != this.loc
93 {
94 this.onposchanging.run( evp )
95 SetWindowPos( this.hwnd, 0,
96 evp.loc.x, evp.loc.y, evp.loc.width, evp.loc.height,
97 $SWP_NOACTIVATE | $SWP_NOZORDER )
98 RedrawWindow( this.hwnd, 0->RECT, 0, 0x507)
99 }
100 }
101 return 0
102 }
103 }
104 return this->vctrl.defproc( ev )
105 }*/
106
107
108 /*------------------------------------------------------------------------------
109 Virtual Methods
110 */
111
112 method vTabPage vTabPage.mCreateWin <alias=vTabPage_mCreateWin>()
113 {
114 this.CreateWin( "GVForm".ustr(), 0,
115 $WS_CHILD | $WS_CLIPSIBLINGS | $WS_CLIPCHILDREN )
116 this->vCtrl.mCreateWin()
117 SendMessage( this.hwnd, $WM_SETFONT, GetStockObject( $DEFAULT_GUI_FONT ),0 )
118 return this
119 }
120
121
122 /*------------------------------------------------------------------------------
123 Registration
124 */
125 method vTabPage vTabPage.init( )
126 {
127 this.pTypeId = vTabPage
128
129 this.pCanContain = 1
130 this.pVisible = 0
131 return this
132 }
133
134 method vTabPage.getprops( uint typeid, compMan cm )
135 {
136 this->vCtrl.getprops( typeid, cm)
137 /* cm.addprops( typeid,
138 %{ "caption" , str, 0})*/
139 }
140 /*
141 method vTabPage.getevents()
142 {
143 %{"onclick"}
144 }
145 */
146
147 func init_vTabPage <entry>()
148 {
149 regcomp( vTabPage, "vTabPage", vCtrl, $vCtrl_last,
150 %{ %{$mCreateWin, vTabPage_mCreateWin }},
151 0->collection )
152 }
153