Changeset 43 for trunk/Forms
- Timestamp:
- Dec 2, 2021, 2:13:03 PM (3 years ago)
- Location:
- trunk/Forms
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UFormContact.lfm
r42 r43 18 18 Top = 8 19 19 Width = 939 20 ActivePage = TabSheet Others20 ActivePage = TabSheetGeneral 21 21 Anchors = [akTop, akLeft, akRight, akBottom] 22 22 ParentFont = False 23 TabIndex = 323 TabIndex = 0 24 24 TabOrder = 0 25 25 object TabSheetGeneral: TTabSheet … … 30 30 ParentFont = False 31 31 object Label1: TLabel 32 Left = 1633 Height = 24 34 Top = 7232 Left = 240 33 Height = 24 34 Top = 80 35 35 Width = 94 36 36 Caption = 'First name:' … … 39 39 end 40 40 object EditFirstName: TEdit 41 Left = 14442 Height = 42 43 Top = 6444 Width = 25441 Left = 360 42 Height = 42 43 Top = 72 44 Width = 155 45 45 ParentFont = False 46 46 TabOrder = 0 … … 49 49 Left = 16 50 50 Height = 24 51 Top = 2 2651 Top = 250 52 52 Width = 63 53 53 Caption = 'Mobile:' … … 58 58 Left = 144 59 59 Height = 42 60 Top = 2 1660 Top = 240 61 61 Width = 254 62 62 ParentFont = False … … 66 66 Left = 144 67 67 Height = 42 68 Top = 2 6268 Top = 286 69 69 Width = 254 70 70 ParentFont = False … … 74 74 Left = 16 75 75 Height = 24 76 Top = 2 6676 Top = 290 77 77 Width = 59 78 78 Caption = 'Phone:' … … 83 83 Left = 144 84 84 Height = 42 85 Top = 3 0485 Top = 328 86 86 Width = 254 87 87 ParentFont = False … … 91 91 Left = 16 92 92 Height = 24 93 Top = 3 1293 Top = 336 94 94 Width = 58 95 95 Caption = 'E-mail:' … … 98 98 end 99 99 object EditLastName: TEdit 100 Left = 575101 Height = 42 102 Top = 64103 Width = 254100 Left = 671 101 Height = 42 102 Top = 72 103 Width = 155 104 104 ParentFont = False 105 105 TabOrder = 4 106 106 end 107 107 object Label5: TLabel 108 Left = 432109 Height = 24 110 Top = 72108 Left = 536 109 Height = 24 110 Top = 80 111 111 Width = 87 112 112 Caption = 'Last name' … … 117 117 Left = 144 118 118 Height = 42 119 Top = 4 00119 Top = 424 120 120 Width = 254 121 121 ParentFont = False … … 125 125 Left = 16 126 126 Height = 24 127 Top = 4 08127 Top = 432 128 128 Width = 76 129 129 Caption = 'Birthday:' … … 134 134 Left = 16 135 135 Height = 210 136 Top = 496136 Top = 16 137 137 Width = 207 138 138 Proportional = True 139 139 Stretch = True 140 140 end 141 object Label23: TLabel142 Left = 16143 Height = 24144 Top = 456145 Width = 55146 Caption = 'Photo:'147 ParentColor = False148 ParentFont = False149 end150 141 object Label24: TLabel 151 Left = 16152 Height = 24 153 Top = 24142 Left = 240 143 Height = 24 144 Top = 32 154 145 Width = 88 155 146 Caption = 'Full name:' … … 158 149 end 159 150 object EditFullName: TEdit 160 Left = 144161 Height = 42 162 Top = 16163 Width = 254151 Left = 360 152 Height = 42 153 Top = 24 154 Width = 467 164 155 ParentFont = False 165 156 TabOrder = 6 166 157 end 167 158 object Label25: TLabel 168 Left = 432169 Height = 24 170 Top = 24159 Left = 536 160 Height = 24 161 Top = 128 171 162 Width = 116 172 163 Caption = 'Middle name:' … … 175 166 end 176 167 object EditMiddleName: TEdit 177 Left = 575178 Height = 42 179 Top = 1 6180 Width = 254168 Left = 671 169 Height = 42 170 Top = 120 171 Width = 155 181 172 ParentFont = False 182 173 TabOrder = 7 183 174 end 184 175 object Label26: TLabel 185 Left = 16186 Height = 24 187 Top = 1 20176 Left = 240 177 Height = 24 178 Top = 176 188 179 Width = 101 189 180 Caption = 'Title before:' … … 192 183 end 193 184 object EditTitleBefore: TEdit 194 Left = 144195 Height = 42 196 Top = 1 12197 Width = 254185 Left = 360 186 Height = 42 187 Top = 168 188 Width = 155 198 189 ParentFont = False 199 190 TabOrder = 8 200 191 end 201 192 object Label27: TLabel 202 Left = 432203 Height = 24 204 Top = 1 20193 Left = 536 194 Height = 24 195 Top = 176 205 196 Width = 85 206 197 Caption = 'Title after:' … … 209 200 end 210 201 object EditTitleAfter: TEdit 211 Left = 575212 Height = 42 213 Top = 1 12214 Width = 254202 Left = 671 203 Height = 42 204 Top = 168 205 Width = 155 215 206 ParentFont = False 216 207 TabOrder = 9 217 208 end 218 209 object Label44: TLabel 219 Left = 16220 Height = 24 221 Top = 1 68210 Left = 240 211 Height = 24 212 Top = 128 222 213 Width = 91 223 214 Caption = 'Nickname:' … … 226 217 end 227 218 object EditNickName: TEdit 228 Left = 144229 Height = 42 230 Top = 1 60231 Width = 254219 Left = 360 220 Height = 42 221 Top = 120 222 Width = 155 232 223 ParentFont = False 233 224 TabOrder = 10 … … 236 227 Left = 432 237 228 Height = 24 238 Top = 4 08229 Top = 432 239 230 Width = 105 240 231 Caption = 'Anniversary:' … … 245 236 Left = 575 246 237 Height = 42 247 Top = 4 00238 Top = 424 248 239 Width = 254 249 240 ParentFont = False … … 253 244 Left = 432 254 245 Height = 24 255 Top = 2 24246 Top = 248 256 247 Width = 34 257 248 Caption = 'Fax:' … … 262 253 Left = 575 263 254 Height = 42 264 Top = 2 16255 Top = 240 265 256 Width = 254 266 257 ParentFont = False … … 270 261 Left = 575 271 262 Height = 42 272 Top = 2 62263 Top = 286 273 264 Width = 254 274 265 ParentFont = False … … 278 269 Left = 432 279 270 Height = 24 280 Top = 2 66271 Top = 290 281 272 Width = 54 282 273 Caption = 'Pager:' … … 287 278 Left = 16 288 279 Height = 24 289 Top = 3 60280 Top = 384 290 281 Width = 114 291 282 Caption = 'Web address:' … … 296 287 Left = 144 297 288 Height = 42 298 Top = 3 52289 Top = 376 299 290 Width = 683 300 291 ParentFont = False … … 883 874 TabOrder = 2 884 875 end 876 object ButtonPrevious: TButton 877 Left = 8 878 Height = 37 879 Top = 800 880 Width = 119 881 Anchors = [akLeft, akBottom] 882 Caption = 'Previous' 883 OnClick = ButtonPreviousClick 884 ParentFont = False 885 TabOrder = 3 886 Visible = False 887 end 888 object ButtonNext: TButton 889 Left = 144 890 Height = 37 891 Top = 800 892 Width = 115 893 Anchors = [akLeft, akBottom] 894 Caption = 'Next' 895 OnClick = ButtonNextClick 896 ParentFont = False 897 TabOrder = 4 898 Visible = False 899 end 885 900 object ActionList1: TActionList 886 901 Images = Core.ImageList1 887 Left = 320888 Top = 568902 Left = 848 903 Top = 488 889 904 object AEditField: TAction 890 905 Caption = 'Edit' … … 893 908 object PopupMenu1: TPopupMenu 894 909 Images = Core.ImageList1 895 Left = 184896 Top = 568910 Left = 856 911 Top = 368 897 912 object MenuItem1: TMenuItem 898 913 Action = AEditField -
trunk/Forms/UFormContact.lrj
r40 r43 8 8 {"hash":174528181,"name":"tformcontact.label5.caption","sourcebytes":[76,97,115,116,32,110,97,109,101],"value":"Last name"}, 9 9 {"hash":162456010,"name":"tformcontact.label22.caption","sourcebytes":[66,105,114,116,104,100,97,121,58],"value":"Birthday:"}, 10 {"hash":91188010,"name":"tformcontact.label23.caption","sourcebytes":[80,104,111,116,111,58],"value":"Photo:"},11 10 {"hash":242270122,"name":"tformcontact.label24.caption","sourcebytes":[70,117,108,108,32,110,97,109,101,58],"value":"Full name:"}, 12 11 {"hash":40626346,"name":"tformcontact.label25.caption","sourcebytes":[77,105,100,100,108,101,32,110,97,109,101,58],"value":"Middle name:"}, … … 56 55 {"hash":77089212,"name":"tformcontact.buttoncancel.caption","sourcebytes":[67,97,110,99,101,108],"value":"Cancel"}, 57 56 {"hash":1339,"name":"tformcontact.buttonok.caption","sourcebytes":[79,75],"value":"OK"}, 57 {"hash":147653555,"name":"tformcontact.buttonprevious.caption","sourcebytes":[80,114,101,118,105,111,117,115],"value":"Previous"}, 58 {"hash":347380,"name":"tformcontact.buttonnext.caption","sourcebytes":[78,101,120,116],"value":"Next"}, 58 59 {"hash":310020,"name":"tformcontact.aeditfield.caption","sourcebytes":[69,100,105,116],"value":"Edit"} 59 60 ]} -
trunk/Forms/UFormContact.pas
r42 r43 7 7 uses 8 8 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls, 9 ComCtrls, ActnList, Menus, ExtCtrls, UContact, base64,UFormProperties;9 ComCtrls, ActnList, Menus, ExtCtrls, UContact, UFormProperties; 10 10 11 11 type … … 17 17 ActionList1: TActionList; 18 18 ButtonCancel: TButton; 19 ButtonNext: TButton; 19 20 ButtonOk: TButton; 21 ButtonPrevious: TButton; 20 22 EditHomeAddressCity: TEdit; 21 23 EditHomeAddressCountry: TEdit; … … 78 80 Label2: TLabel; 79 81 Label22: TLabel; 80 Label23: TLabel;81 82 Label24: TLabel; 82 83 Label25: TLabel; … … 120 121 TabSheetGeneral: TTabSheet; 121 122 TabSheetAll: TTabSheet; 123 procedure ButtonNextClick(Sender: TObject); 122 124 procedure ButtonOkClick(Sender: TObject); 125 procedure ButtonPreviousClick(Sender: TObject); 123 126 procedure FormClose(Sender: TObject; var CloseAction: TCloseAction); 124 127 procedure FormCreate(Sender: TObject); … … 130 133 private 131 134 FContact: TContact; 135 FOnNext: TNotifyEvent; 136 FOnPrevious: TNotifyEvent; 132 137 FormProperties: TFormProperties; 133 138 procedure SetContact(AValue: TContact); … … 136 141 procedure SaveData; 137 142 property Contact: TContact read FContact write SetContact; 143 property OnPrevious: TNotifyEvent read FOnPrevious write FOnPrevious; 144 property OnNext: TNotifyEvent read FOnNext write FOnNext; 138 145 end; 139 146 … … 148 155 uses 149 156 UCore; 150 151 resourcestring152 SFieldEdit = 'Field edit';153 SEditFieldValue = 'Edit field value';154 157 155 158 { TFormContact } … … 204 207 begin 205 208 SaveData; 209 end; 210 211 procedure TFormContact.ButtonNextClick(Sender: TObject); 212 begin 213 if Assigned(FOnNext) then FOnNext(Self); 214 end; 215 216 procedure TFormContact.ButtonPreviousClick(Sender: TObject); 217 begin 218 if Assigned(FOnPrevious) then FOnPrevious(Self); 206 219 end; 207 220 -
trunk/Forms/UFormContacts.pas
r42 r43 51 51 procedure FilterList(List: TFPGObjectList<TObject>); 52 52 procedure SetContacts(AValue: TContacts); 53 procedure FormContactPrevious(Sender: TObject); 54 procedure FormContactNext(Sender: TObject); 53 55 public 54 56 property Contacts: TContacts read FContacts write SetContacts; … … 183 185 end; 184 186 187 procedure TFormContacts.FormContactPrevious(Sender: TObject); 188 var 189 I: Integer; 190 begin 191 I := ListViewSort1.List.IndexOf(TFormContact(Sender).Contact); 192 if (I <> -1) and (I > 0) then 193 TFormContact(Sender).Contact := TContact(ListViewSort1.List[I - 1]); 194 end; 195 196 procedure TFormContacts.FormContactNext(Sender: TObject); 197 var 198 I: Integer; 199 begin 200 I := ListViewSort1.List.IndexOf(TFormContact(Sender).Contact); 201 if (I <> -1) and (I < ListViewSort1.List.Count - 1) then 202 TFormContact(Sender).Contact := TContact(ListViewSort1.List[I + 1]); 203 end; 204 185 205 procedure TFormContacts.FormShow(Sender: TObject); 186 206 begin … … 204 224 Contact.Parent := Contacts.ContactsFile; 205 225 FormContact.Contact := Contact; 226 FormContact.OnPrevious := FormContactPrevious; 227 FormContact.OnNext := FormContactNext; 206 228 if FormContact.ShowModal = mrOK then begin 207 229 Contacts.Add(Contact); … … 230 252 Contact.Assign(TContact(ListView1.Selected.Data)); 231 253 FormContact.Contact := Contact; 254 FormContact.OnPrevious := FormContactPrevious; 255 FormContact.OnNext := FormContactNext; 232 256 try 233 257 if FormContact.ShowModal = mrOK then begin
Note:
See TracChangeset
for help on using the changeset viewer.