source: trunk/desktop/createProfile.rbfrm @ 33

Revision 33, 6.2 KB checked in by pinwc4, 15 years ago (diff)

Resized linux controls

Line 
1#tag Window
2Begin Window createProfile
3   BackColor       =   &hFFFFFF
4   Backdrop        =   ""
5   CloseButton     =   True
6   Composite       =   False
7   Frame           =   0
8   FullScreen      =   False
9   HasBackColor    =   False
10   Height          =   120
11   ImplicitInstance=   True
12   LiveResize      =   True
13   MacProcID       =   0
14   MaxHeight       =   32000
15   MaximizeButton  =   False
16   MaxWidth        =   32000
17   MenuBar         =   ""
18   MenuBarVisible  =   True
19   MinHeight       =   64
20   MinimizeButton  =   True
21   MinWidth        =   64
22   Placement       =   0
23   Resizeable      =   False
24   Title           =   "Create Profile"
25   Visible         =   True
26   Width           =   300
27   Begin EditField EditField_Name
28      AcceptTabs      =   ""
29      Alignment       =   0
30      AutoDeactivate  =   True
31      BackColor       =   &hFFFFFF
32      Bold            =   ""
33      Border          =   True
34      DataField       =   ""
35      DataSource      =   ""
36      Enabled         =   True
37      Format          =   ""
38      Height          =   22
39      HelpTag         =   ""
40      Index           =   -2147483648
41      InitialParent   =   ""
42      Italic          =   ""
43      Left            =   20
44      LimitText       =   0
45      LockBottom      =   ""
46      LockedInPosition=   False
47      LockLeft        =   ""
48      LockRight       =   ""
49      LockTop         =   ""
50      Mask            =   ""
51      Multiline       =   ""
52      Password        =   ""
53      ReadOnly        =   ""
54      Scope           =   0
55      ScrollbarHorizontal=   ""
56      ScrollbarVertical=   True
57      Styled          =   ""
58      TabIndex        =   0
59      TabPanelIndex   =   0
60      TabStop         =   True
61      Text            =   ""
62      TextColor       =   &h000000
63      TextFont        =   "System"
64      TextSize        =   0
65      TextUnit        =   0
66      Top             =   46
67      Underline       =   ""
68      UseFocusRing    =   True
69      Visible         =   True
70      Width           =   260
71   End
72   Begin PushButton PushButton_OK
73      AutoDeactivate  =   True
74      Bold            =   ""
75      Cancel          =   ""
76      Caption         =   "OK"
77      Default         =   ""
78      Enabled         =   True
79      Height          =   20
80      HelpTag         =   ""
81      Index           =   -2147483648
82      InitialParent   =   ""
83      Italic          =   ""
84      Left            =   20
85      LockBottom      =   ""
86      LockedInPosition=   False
87      LockLeft        =   ""
88      LockRight       =   ""
89      LockTop         =   ""
90      Scope           =   0
91      TabIndex        =   1
92      TabPanelIndex   =   0
93      TabStop         =   True
94      TextFont        =   "System"
95      TextSize        =   0
96      TextUnit        =   0
97      Top             =   80
98      Underline       =   ""
99      Visible         =   True
100      Width           =   80
101   End
102   Begin PushButton PushButton_Cancel
103      AutoDeactivate  =   True
104      Bold            =   ""
105      Cancel          =   ""
106      Caption         =   "Cancel"
107      Default         =   ""
108      Enabled         =   True
109      Height          =   20
110      HelpTag         =   ""
111      Index           =   -2147483648
112      InitialParent   =   ""
113      Italic          =   ""
114      Left            =   200
115      LockBottom      =   ""
116      LockedInPosition=   False
117      LockLeft        =   ""
118      LockRight       =   ""
119      LockTop         =   ""
120      Scope           =   0
121      TabIndex        =   2
122      TabPanelIndex   =   0
123      TabStop         =   True
124      TextFont        =   "System"
125      TextSize        =   0
126      TextUnit        =   0
127      Top             =   80
128      Underline       =   ""
129      Visible         =   True
130      Width           =   80
131   End
132   Begin StaticText StaticText_name
133      AutoDeactivate  =   True
134      Bold            =   ""
135      DataField       =   ""
136      DataSource      =   ""
137      Enabled         =   True
138      Height          =   20
139      HelpTag         =   ""
140      Index           =   -2147483648
141      InitialParent   =   ""
142      Italic          =   ""
143      Left            =   20
144      LockBottom      =   ""
145      LockedInPosition=   False
146      LockLeft        =   ""
147      LockRight       =   ""
148      LockTop         =   ""
149      Multiline       =   ""
150      Scope           =   0
151      TabIndex        =   3
152      TabPanelIndex   =   0
153      Text            =   "Enter new profile name"
154      TextAlign       =   0
155      TextColor       =   &h000000
156      TextFont        =   "System"
157      TextSize        =   0
158      TextUnit        =   0
159      Top             =   14
160      Underline       =   ""
161      Visible         =   True
162      Width           =   260
163   End
164End
165#tag EndWindow
166
167#tag WindowCode
168        #tag Event
169                Sub Open()
170                  allowedText = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 -_."+chr(8)+chr(29)+chr(30)+chr(31)+chr(28)+chr(127)
171                 
172                  #if TargetLinux
173                    PushButton_Cancel.Height = 24
174                    PushButton_OK.Height = 24
175                  #endif
176                End Sub
177        #tag EndEvent
178
179
180        #tag Property, Flags = &h0
181                allowedText As String
182        #tag EndProperty
183
184
185#tag EndWindowCode
186
187#tag Events EditField_Name
188        #tag Event
189                Function KeyDown(Key As String) As Boolean
190                  Return InStr(allowedText,key)=0
191                End Function
192        #tag EndEvent
193#tag EndEvents
194#tag Events PushButton_OK
195        #tag Event
196                Sub Action()
197                  dim success as Boolean
198                 
199                 
200                  if EditField_Name.Text <> "none" and EditField_Name.Text <> "None" and EditField_Name.Text <> "" then
201                   
202                    success = mainWindow.ICSSerialPort1.createProfile(EditField_Name.Text)
203                   
204                    if success = true then
205                      dim i as integer
206                     
207                      //cheesy way to update the popup menu
208                      mainWindow.PopupMenu_Profile.AddRow(EditField_Name.Text)
209                     
210                      for i = 0 to mainWindow.PopupMenu_Profile.ListCount - 1
211                        if EditField_Name.Text = mainWindow.PopupMenu_Profile.List(i) then
212                          mainWindow.PopupMenu_Profile.ListIndex = i
213                        end if
214                      next
215                      self.Close
216                     
217                    else
218                     
219                      MsgBox "Error creating profile, please try a different name"
220                     
221                    end if
222                   
223                  end if
224                 
225                 
226                End Sub
227        #tag EndEvent
228#tag EndEvents
229#tag Events PushButton_Cancel
230        #tag Event
231                Sub Action()
232                  self.Close
233                End Sub
234        #tag EndEvent
235#tag EndEvents
Note: See TracBrowser for help on using the repository browser.