Changeset 5
- Timestamp:
- Jun 3, 2010, 6:00:52 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UItemEdit.lfm
r4 r5 5 5 Width = 558 6 6 ActiveControl = Panel1 7 Caption = ' ItemEditForm'7 Caption = 'Úprava položky' 8 8 ClientHeight = 429 9 9 ClientWidth = 558 -
trunk/Forms/UItemEdit.pas
r4 r5 7 7 uses 8 8 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ExtCtrls, 9 StdCtrls, Spin, EditBtn, USqlDatabase ;9 StdCtrls, Spin, EditBtn, USqlDatabase, MaskEdit; 10 10 11 11 type … … 128 128 TEdit(NewControl).Text := Values[0].Values[Properties[I].Values['ColumnName']]; 129 129 TEdit(NewControl).Width := (Width div ColumnCount) div 2 - 20; 130 end else 131 if ValueType = Integer(vtPassword) then begin 132 NewControl := TMaskEdit.Create(Panel1); 133 NewControl.Parent := Panel1; 134 NewControl.Top := LastTop; 135 NewControl.Left := Column * Width div ColumnCount + (Width div ColumnCount) div 2; 136 TMaskEdit(NewControl).Width := (Width div ColumnCount) div 2 - 20; 137 end else 138 if ValueType = Integer(vtBoolean) then begin 139 NewControl := TCheckBox.Create(Panel1); 140 NewControl.Parent := Panel1; 141 NewControl.Top := LastTop; 142 NewControl.Left := Column * Width div ColumnCount + (Width div ColumnCount) div 2; 143 TCheckBox(NewControl).Checked := Boolean(StrToInt(Values[0].Values[Properties[I].Values['ColumnName']])); 144 end else begin 145 NewControl := TEdit.Create(Panel1); 146 NewControl.Parent := Panel1; 147 NewControl.Top := LastTop; 148 NewControl.Left := Column * Width div ColumnCount + (Width div ColumnCount) div 2; 149 TEdit(NewControl).Width := (Width div ColumnCount) div 2 - 20; 150 TEdit(NewControl).Text := Values[0].Values[Properties[I].Values['ColumnName']]; 130 151 end; 131 152 -
trunk/Forms/UMainForm.lfm
r4 r5 32 32 object TreeView1: TTreeView 33 33 Left = 8 34 Height = 4 1334 Height = 421 35 35 Top = 19 36 36 Width = 176 … … 110 110 top = 120 111 111 object AItemDelete: TAction 112 Category = ' Object'112 Category = 'Item' 113 113 Caption = 'Smazat' 114 114 end 115 115 object AItemAdd: TAction 116 Category = ' Object'116 Category = 'Item' 117 117 Caption = 'Přidat' 118 118 OnExecute = AItemAddExecute 119 119 end 120 120 object AItemEdit: TAction 121 Category = 'Item' 122 Caption = 'Upravit' 123 OnExecute = AItemEditExecute 124 end 125 object AItemView: TAction 126 Category = 'Item' 127 Caption = 'Zobrazit' 128 OnExecute = AItemViewExecute 129 end 130 object AObjectGroupDelete: TAction 131 Category = 'ObjectGroup' 132 Caption = 'Odebrat' 133 end 134 object AObjectGroupAddGroup: TAction 135 Category = 'ObjectGroup' 136 Caption = 'Přidat skupinu' 137 OnExecute = AObjectGroupAddGroupExecute 138 end 139 object AObjectGroupAddObject: TAction 140 Category = 'ObjectGroup' 141 Caption = 'Přidat objekt' 142 end 143 object AObjectGroupEdit: TAction 144 Category = 'ObjectGroup' 145 Caption = 'Upravit' 146 OnExecute = AObjectGroupEditExecute 147 end 148 object AObjectDelete: TAction 149 Category = 'Object' 150 Caption = 'Odstranit' 151 end 152 object AObjectEdit: TAction 121 153 Category = 'Object' 122 154 Caption = 'Upravit' 123 OnExecute = AItemEditExecute 124 end 125 object AItemView: TAction 126 Category = 'Object' 127 Caption = 'Zobrazit' 128 OnExecute = AItemViewExecute 129 end 130 object AObjectGroupDelete: TAction 131 Category = 'ObjectGroup' 132 Caption = 'Odebrat' 133 end 134 object AObjectGroupAddGroup: TAction 135 Category = 'ObjectGroup' 136 Caption = 'Přidat skupinu' 137 OnExecute = AObjectGroupAddGroupExecute 138 end 139 object AObjectGroupAddObject: TAction 140 Category = 'ObjectGroup' 141 Caption = 'Přidat objekt' 142 end 143 object AObjectGroupEdit: TAction 144 Category = 'ObjectGroup' 145 Caption = 'Upravit' 155 OnExecute = AObjectEditExecute 146 156 end 147 157 end … … 170 180 left = 72 171 181 top = 136 182 object MenuItem9: TMenuItem 183 Action = AObjectDelete 184 end 185 object MenuItem10: TMenuItem 186 Action = AObjectEdit 187 end 172 188 end 173 189 object PopupMenuObjectGroup: TPopupMenu -
trunk/Forms/UMainForm.pas
r4 r5 21 21 22 22 TMainForm = class(TForm) 23 AObjectEdit: TAction; 24 AObjectDelete: TAction; 23 25 AObjectGroupEdit: TAction; 24 26 AObjectGroupAddObject: TAction; … … 37 39 ListView1: TListView; 38 40 MenuItem1: TMenuItem; 41 MenuItem10: TMenuItem; 39 42 MenuItem2: TMenuItem; 40 43 MenuItem3: TMenuItem; … … 44 47 MenuItem7: TMenuItem; 45 48 MenuItem8: TMenuItem; 49 MenuItem9: TMenuItem; 46 50 Panel1: TPanel; 47 51 Panel2: TPanel; … … 54 58 procedure AItemEditExecute(Sender: TObject); 55 59 procedure AItemViewExecute(Sender: TObject); 60 procedure AObjectEditExecute(Sender: TObject); 56 61 procedure AObjectGroupAddGroupExecute(Sender: TObject); 62 procedure AObjectGroupEditExecute(Sender: TObject); 57 63 procedure ButtonAddClick(Sender: TObject); 58 64 procedure FormClose(Sender: TObject; var CloseAction: TCloseAction); … … 84 90 85 91 uses 86 UItemView, UItemEdit ;92 UItemView, UItemEdit, UItemAdd; 87 93 88 94 {$R *.lfm} … … 153 159 end; 154 160 161 procedure TMainForm.AObjectEditExecute(Sender: TObject); 162 begin 163 if Assigned(TreeView1.Selected) then begin 164 SelectedObject := 9; 165 SelectedItem := Integer(TreeView1.Selected.Data); 166 ItemEditForm.Show; 167 end; 168 end; 169 155 170 procedure TMainForm.AObjectGroupAddGroupExecute(Sender: TObject); 156 171 begin … … 158 173 end; 159 174 175 procedure TMainForm.AObjectGroupEditExecute(Sender: TObject); 176 begin 177 if Assigned(TreeView1.Selected) then begin 178 SelectedObject := 8; 179 SelectedItem := Integer(TreeView1.Selected.Data); 180 ItemEditForm.Show; 181 end; 182 end; 183 160 184 procedure TMainForm.AItemEditExecute(Sender: TObject); 161 185 begin … … 165 189 procedure TMainForm.AItemAddExecute(Sender: TObject); 166 190 begin 167 191 ItemAddForm.Show; 168 192 end; 169 193 … … 206 230 procedure TMainForm.TreeView1Change(Sender: TObject; Node: TTreeNode); 207 231 begin 208 LoadItemList;209 232 AObjectGroupDelete.Enabled := Assigned(TreeView1.Selected); 210 233 AObjectGroupEdit.Enabled := Assigned(TreeView1.Selected); 211 234 if Assigned(TreeView1.Selected) then begin 212 if TreeView1.Selected.ImageIndex = 0 then 235 if TreeView1.Selected.ImageIndex = 0 then begin 213 236 TreeView1.PopupMenu := PopupMenuObjectGroup; 214 if TreeView1.Selected.ImageIndex = 1 then 237 ListView1.Visible := False; 238 end; 239 if TreeView1.Selected.ImageIndex = 1 then begin 215 240 TreeView1.PopupMenu := PopupMenuObject; 241 LoadItemList; 242 end; 216 243 end; 217 244 end; … … 237 264 NewNode.ImageIndex := 0; 238 265 NewNode.SelectedIndex := 0; 266 NewNode.Data := Pointer(StrToInt(DbRows[I].Values['Id'])); 239 267 ObjectDbRows := Database.Query('SELECT * FROM `Object` WHERE `Group`=' + DbRows[I].Values['Id']); 240 268 for O := 0 to ObjectDbRows.Count - 1 do begin … … 263 291 begin 264 292 SelectedObject := 0; 265 if Assigned(TreeView1.Selected) 293 if Assigned(TreeView1.Selected)then 266 294 with ListView1, Items do begin 295 Visible := True; 267 296 Clear; 268 297 DbRows := Database.Query('SELECT * FROM `Object` WHERE `Id`=' + IntToStr(Integer(TreeView1.Selected.Data))); -
trunk/chronis.lpi
r4 r5 37 37 </Item1> 38 38 </RequiredPackages> 39 <Units Count="1 6">39 <Units Count="17"> 40 40 <Unit0> 41 41 <Filename Value="chronis.lpr"/> … … 46 46 <WindowIndex Value="1"/> 47 47 <TopLine Value="1"/> 48 <CursorPos X="59" Y="2 3"/>49 <UsageCount Value="14 8"/>48 <CursorPos X="59" Y="24"/> 49 <UsageCount Value="149"/> 50 50 <Loaded Value="True"/> 51 51 </Unit0> … … 58 58 <TopLine Value="1"/> 59 59 <CursorPos X="29" Y="1"/> 60 <UsageCount Value="1 6"/>60 <UsageCount Value="15"/> 61 61 </Unit1> 62 62 <Unit2> … … 68 68 <TopLine Value="1"/> 69 69 <CursorPos X="37" Y="1"/> 70 <UsageCount Value="1 6"/>70 <UsageCount Value="15"/> 71 71 </Unit2> 72 72 <Unit3> … … 76 76 <TopLine Value="330"/> 77 77 <CursorPos X="1" Y="347"/> 78 <UsageCount Value="8 2"/>78 <UsageCount Value="81"/> 79 79 </Unit3> 80 80 <Unit4> … … 87 87 <TopLine Value="118"/> 88 88 <CursorPos X="25" Y="144"/> 89 <UsageCount Value="13 6"/>89 <UsageCount Value="135"/> 90 90 </Unit4> 91 91 <Unit5> … … 98 98 <TopLine Value="1"/> 99 99 <CursorPos X="24" Y="14"/> 100 <UsageCount Value="13 6"/>100 <UsageCount Value="135"/> 101 101 </Unit5> 102 102 <Unit6> … … 104 104 <IsPartOfProject Value="True"/> 105 105 <UnitName Value="UPersistentForm"/> 106 <EditorIndex Value="4"/>107 106 <WindowIndex Value="0"/> 108 107 <TopLine Value="42"/> 109 108 <CursorPos X="33" Y="46"/> 110 <UsageCount Value="138"/> 111 <Loaded Value="True"/> 109 <UsageCount Value="139"/> 112 110 </Unit6> 113 111 <Unit7> … … 118 116 <WindowIndex Value="0"/> 119 117 <TopLine Value="385"/> 120 <CursorPos X=" 1" Y="374"/>121 <UsageCount Value="13 8"/>118 <CursorPos X="25" Y="373"/> 119 <UsageCount Value="139"/> 122 120 <Loaded Value="True"/> 123 121 </Unit7> … … 129 127 <TopLine Value="32"/> 130 128 <CursorPos X="21" Y="13"/> 131 <UsageCount Value="13 8"/>129 <UsageCount Value="139"/> 132 130 </Unit8> 133 131 <Unit9> … … 139 137 <EditorIndex Value="0"/> 140 138 <WindowIndex Value="0"/> 141 <TopLine Value=" 68"/>142 <CursorPos X=" 30" Y="100"/>143 <UsageCount Value="3 4"/>139 <TopLine Value="82"/> 140 <CursorPos X="27" Y="112"/> 141 <UsageCount Value="35"/> 144 142 <Loaded Value="True"/> 145 143 </Unit9> … … 152 150 <EditorIndex Value="1"/> 153 151 <WindowIndex Value="0"/> 154 <TopLine Value=" 93"/>155 <CursorPos X=" 7" Y="114"/>156 <UsageCount Value="2 5"/>152 <TopLine Value="125"/> 153 <CursorPos X="16" Y="137"/> 154 <UsageCount Value="26"/> 157 155 <Loaded Value="True"/> 158 156 </Unit10> … … 162 160 <HasResources Value="True"/> 163 161 <UnitName Value="ULoginForm"/> 164 <UsageCount Value="2 4"/>162 <UsageCount Value="25"/> 165 163 </Unit11> 166 164 <Unit12> … … 171 169 <ResourceBaseClass Value="Form"/> 172 170 <UnitName Value="UMainForm"/> 173 <IsVisibleTab Value="True"/>174 171 <EditorIndex Value="3"/> 175 172 <WindowIndex Value="0"/> 176 <TopLine Value=" 253"/>177 <CursorPos X=" 112" Y="268"/>178 <UsageCount Value="2 4"/>173 <TopLine Value="77"/> 174 <CursorPos X="33" Y="92"/> 175 <UsageCount Value="25"/> 179 176 <Loaded Value="True"/> 180 177 </Unit12> … … 203 200 <IsPartOfProject Value="True"/> 204 201 <UnitName Value="UTreeState"/> 205 <UsageCount Value="2 1"/>202 <UsageCount Value="22"/> 206 203 <DefaultSyntaxHighlighter Value="Text"/> 207 204 </Unit15> 205 <Unit16> 206 <Filename Value="Forms/UItemAdd.pas"/> 207 <IsPartOfProject Value="True"/> 208 <ComponentName Value="ItemAddForm"/> 209 <ResourceBaseClass Value="Form"/> 210 <UnitName Value="UItemAdd"/> 211 <IsVisibleTab Value="True"/> 212 <EditorIndex Value="4"/> 213 <WindowIndex Value="0"/> 214 <TopLine Value="116"/> 215 <CursorPos X="27" Y="130"/> 216 <UsageCount Value="21"/> 217 <Loaded Value="True"/> 218 </Unit16> 208 219 </Units> 209 220 <JumpHistory Count="30" HistoryIndex="29"> 210 221 <Position1> 211 222 <Filename Value="Forms/UItemEdit.pas"/> 212 <Caret Line=" 109" Column="33" TopLine="90"/>223 <Caret Line="78" Column="1" TopLine="57"/> 213 224 </Position1> 214 225 <Position2> 215 226 <Filename Value="Forms/UItemEdit.pas"/> 216 <Caret Line=" 108" Column="33" TopLine="89"/>227 <Caret Line="79" Column="1" TopLine="57"/> 217 228 </Position2> 218 229 <Position3> 219 230 <Filename Value="Forms/UItemEdit.pas"/> 220 <Caret Line=" 116" Column="36" TopLine="89"/>231 <Caret Line="81" Column="1" TopLine="57"/> 221 232 </Position3> 222 233 <Position4> 223 <Filename Value="Forms/U MainForm.pas"/>224 <Caret Line=" 18" Column="39" TopLine="1"/>234 <Filename Value="Forms/UItemEdit.pas"/> 235 <Caret Line="85" Column="1" TopLine="57"/> 225 236 </Position4> 226 237 <Position5> 227 <Filename Value="Forms/U MainForm.pas"/>228 <Caret Line=" 189" Column="41" TopLine="182"/>238 <Filename Value="Forms/UItemEdit.pas"/> 239 <Caret Line="86" Column="1" TopLine="57"/> 229 240 </Position5> 230 241 <Position6> 231 <Filename Value="Forms/U MainForm.pas"/>232 <Caret Line=" 185" Column="29" TopLine="166"/>242 <Filename Value="Forms/UItemEdit.pas"/> 243 <Caret Line="87" Column="1" TopLine="57"/> 233 244 </Position6> 234 245 <Position7> 235 <Filename Value="Forms/U MainForm.pas"/>236 <Caret Line=" 218" Column="23" TopLine="194"/>246 <Filename Value="Forms/UItemEdit.pas"/> 247 <Caret Line="89" Column="1" TopLine="57"/> 237 248 </Position7> 238 249 <Position8> 239 <Filename Value="Forms/U MainForm.pas"/>240 <Caret Line=" 219" Column="23" TopLine="195"/>250 <Filename Value="Forms/UItemEdit.pas"/> 251 <Caret Line="90" Column="1" TopLine="58"/> 241 252 </Position8> 242 253 <Position9> 243 <Filename Value="Forms/U MainForm.pas"/>244 <Caret Line=" 220" Column="23" TopLine="196"/>254 <Filename Value="Forms/UItemEdit.pas"/> 255 <Caret Line="91" Column="1" TopLine="59"/> 245 256 </Position9> 246 257 <Position10> 247 258 <Filename Value="Forms/UMainForm.pas"/> 248 <Caret Line="2 21" Column="23" TopLine="197"/>259 <Caret Line="237" Column="22" TopLine="220"/> 249 260 </Position10> 250 261 <Position11> 251 262 <Filename Value="Forms/UMainForm.pas"/> 252 <Caret Line=" 196" Column="1" TopLine="185"/>263 <Caret Line="241" Column="14" TopLine="224"/> 253 264 </Position11> 254 265 <Position12> 255 266 <Filename Value="Forms/UMainForm.pas"/> 256 <Caret Line=" 55" Column="15" TopLine="36"/>267 <Caret Line="230" Column="40" TopLine="208"/> 257 268 </Position12> 258 269 <Position13> 259 <Filename Value="Forms/U MainForm.pas"/>260 <Caret Line=" 233" Column="32" TopLine="213"/>270 <Filename Value="Forms/UItemAdd.pas"/> 271 <Caret Line="11" Column="15" TopLine="1"/> 261 272 </Position13> 262 273 <Position14> 263 <Filename Value="Forms/U MainForm.pas"/>264 <Caret Line=" 230" Column="12" TopLine="214"/>274 <Filename Value="Forms/UItemAdd.pas"/> 275 <Caret Line="14" Column="15" TopLine="1"/> 265 276 </Position14> 266 277 <Position15> 267 <Filename Value="Forms/U MainForm.pas"/>268 <Caret Line=" 231" Column="12" TopLine="215"/>278 <Filename Value="Forms/UItemAdd.pas"/> 279 <Caret Line="15" Column="15" TopLine="1"/> 269 280 </Position15> 270 281 <Position16> 271 <Filename Value="Forms/U MainForm.pas"/>272 <Caret Line=" 230" Column="12" TopLine="214"/>282 <Filename Value="Forms/UItemAdd.pas"/> 283 <Caret Line="38" Column="9" TopLine="3"/> 273 284 </Position16> 274 285 <Position17> 275 286 <Filename Value="Forms/UMainForm.pas"/> 276 <Caret Line=" 231" Column="12" TopLine="215"/>287 <Caret Line="191" Column="10" TopLine="189"/> 277 288 </Position17> 278 289 <Position18> 279 <Filename Value="Forms/U MainForm.pas"/>280 <Caret Line=" 230" Column="12" TopLine="214"/>290 <Filename Value="Forms/UItemAdd.pas"/> 291 <Caret Line="9" Column="25" TopLine="1"/> 281 292 </Position18> 282 293 <Position19> 283 <Filename Value="Forms/U MainForm.pas"/>284 <Caret Line=" 229" Column="12" TopLine="213"/>294 <Filename Value="Forms/UItemAdd.pas"/> 295 <Caret Line="51" Column="33" TopLine="31"/> 285 296 </Position19> 286 297 <Position20> 287 <Filename Value="Forms/U MainForm.pas"/>288 <Caret Line=" 230" Column="12" TopLine="214"/>298 <Filename Value="Forms/UItemAdd.pas"/> 299 <Caret Line="57" Column="32" TopLine="38"/> 289 300 </Position20> 290 301 <Position21> 291 <Filename Value="Forms/U MainForm.pas"/>292 <Caret Line="23 1" Column="12" TopLine="215"/>302 <Filename Value="Forms/UItemAdd.pas"/> 303 <Caret Line="23" Column="1" TopLine="5"/> 293 304 </Position21> 294 305 <Position22> 295 <Filename Value="Forms/U MainForm.pas"/>296 <Caret Line=" 232" Column="12" TopLine="216"/>306 <Filename Value="Forms/UItemAdd.pas"/> 307 <Caret Line="88" Column="1" TopLine="81"/> 297 308 </Position22> 298 309 <Position23> 299 <Filename Value="Forms/U MainForm.pas"/>300 <Caret Line=" 231" Column="12" TopLine="215"/>310 <Filename Value="Forms/UItemAdd.pas"/> 311 <Caret Line="121" Column="27" TopLine="97"/> 301 312 </Position23> 302 313 <Position24> 303 <Filename Value="Forms/U MainForm.pas"/>304 <Caret Line=" 230" Column="12" TopLine="214"/>314 <Filename Value="Forms/UItemAdd.pas"/> 315 <Caret Line="124" Column="31" TopLine="97"/> 305 316 </Position24> 306 317 <Position25> 307 <Filename Value="Forms/U MainForm.pas"/>308 <Caret Line=" 229" Column="12" TopLine="213"/>318 <Filename Value="Forms/UItemAdd.pas"/> 319 <Caret Line="125" Column="32" TopLine="104"/> 309 320 </Position25> 310 321 <Position26> 311 <Filename Value="Forms/U MainForm.pas"/>312 <Caret Line=" 228" Column="12" TopLine="212"/>322 <Filename Value="Forms/UItemAdd.pas"/> 323 <Caret Line="126" Column="32" TopLine="105"/> 313 324 </Position26> 314 325 <Position27> 315 <Filename Value="Forms/U MainForm.pas"/>316 <Caret Line=" 229" Column="12" TopLine="213"/>326 <Filename Value="Forms/UItemAdd.pas"/> 327 <Caret Line="125" Column="32" TopLine="104"/> 317 328 </Position27> 318 329 <Position28> 319 <Filename Value="Forms/U MainForm.pas"/>320 <Caret Line=" 230" Column="12" TopLine="214"/>330 <Filename Value="Forms/UItemEdit.pas"/> 331 <Caret Line="148" Column="1" TopLine="112"/> 321 332 </Position28> 322 333 <Position29> 323 <Filename Value="Forms/U MainForm.pas"/>324 <Caret Line=" 231" Column="12" TopLine="215"/>334 <Filename Value="Forms/UItemEdit.pas"/> 335 <Caret Line="9" Column="50" TopLine="1"/> 325 336 </Position29> 326 337 <Position30> 327 <Filename Value="Forms/U MainForm.pas"/>328 <Caret Line=" 232" Column="12" TopLine="216"/>338 <Filename Value="Forms/UItemAdd.pas"/> 339 <Caret Line="9" Column="27" TopLine="1"/> 329 340 </Position30> 330 341 </JumpHistory> -
trunk/chronis.lpr
r4 r5 9 9 Interfaces, // this includes the LCL widgetset 10 10 Forms, UPersistentForm, URegistry, USqlDatabase, UTreeState, 11 UItemView, UItemEdit, ULoginForm, UMainForm 11 UItemView, UItemEdit, ULoginForm, UMainForm, UItemAdd 12 12 { you can add units after this }; 13 13 … … 19 19 Application.CreateForm(TItemViewForm, ItemViewForm); 20 20 Application.CreateForm(TItemEditForm, ItemEditForm); 21 Application.CreateForm(TItemAddForm, ItemAddForm); 21 22 Application.Run; 22 23 end.
Note:
See TracChangeset
for help on using the changeset viewer.