Changeset 15 for trunk/Forms


Ignore:
Timestamp:
Feb 27, 2018, 6:11:44 PM (7 years ago)
Author:
chronos
Message:
  • Added: Partial support for color theming.
  • Added: Allow to edit contact properties in the list of all.
Location:
trunk/Forms
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UFormAbout.pas

    r1 r15  
    6969begin
    7070  Core.CoolTranslator1.TranslateComponentRecursive(Self);
     71  Core.ThemeManager1.UseTheme(Self);
    7172end;
    7273
  • trunk/Forms/UFormContact.lfm

    r9 r15  
    1717    Top = 8
    1818    Width = 744
    19     ActivePage = TabSheetGeneral
     19    ActivePage = TabSheetAll
    2020    Anchors = [akTop, akLeft, akRight, akBottom]
    21     TabIndex = 0
     21    TabIndex = 2
    2222    TabOrder = 0
    2323    object TabSheetGeneral: TTabSheet
     
    398398          end>
    399399        OwnerData = True
     400        PopupMenu = PopupMenu1
    400401        ReadOnly = True
    401402        RowSelect = True
     
    403404        ViewStyle = vsReport
    404405        OnData = ListView1Data
     406        OnDblClick = AEditFieldExecute
    405407      end
    406408    end
     
    426428    TabOrder = 2
    427429  end
     430  object ActionList1: TActionList
     431    Images = Core.ImageList1
     432    left = 317
     433    top = 157
     434    object AEditField: TAction
     435      Caption = 'Edit'
     436      OnExecute = AEditFieldExecute
     437    end
     438  end
     439  object PopupMenu1: TPopupMenu
     440    Images = Core.ImageList1
     441    left = 172
     442    top = 159
     443    object MenuItem1: TMenuItem
     444      Action = AEditField
     445    end
     446  end
    428447end
  • trunk/Forms/UFormContact.pas

    r9 r15  
    77uses
    88  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
    9   ComCtrls, UContact;
     9  ComCtrls, ActnList, Menus, UContact;
    1010
    1111type
     
    1414
    1515  TFormContact = class(TForm)
     16    AEditField: TAction;
     17    ActionList1: TActionList;
    1618    ButtonCancel: TButton;
    1719    ButtonOk: TButton;
     
    6365    ListView1: TListView;
    6466    MemoNotes: TMemo;
     67    MenuItem1: TMenuItem;
    6568    PageControlContact: TPageControl;
     69    PopupMenu1: TPopupMenu;
    6670    TabSheetGeneral: TTabSheet;
    6771    TabSheetDetails: TTabSheet;
    6872    TabSheetAll: TTabSheet;
     73    procedure AEditFieldExecute(Sender: TObject);
    6974    procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
    7075    procedure FormCreate(Sender: TObject);
     
    8994uses
    9095  UCore;
     96
     97resourcestring
     98  SFieldEdit = 'Field edit';
     99  SEditFieldValue = 'Edit field value';
    91100
    92101{ TFormContact }
     
    126135end;
    127136
     137procedure TFormContact.AEditFieldExecute(Sender: TObject);
     138begin
     139  if Assigned(ListView1.Selected) then begin
     140    Contact.Fields[TContactFieldIndex(ListView1.Selected.Index)] :=
     141      InputBox(SFieldEdit, SEditFieldValue, Contact.Fields[TContactFieldIndex(ListView1.Selected.Index)]);
     142  end;
     143end;
     144
    128145procedure TFormContact.FormCreate(Sender: TObject);
    129146begin
    130147  Core.CoolTranslator1.TranslateComponentRecursive(Self);
     148  Core.ThemeManager1.UseTheme(Self);
    131149  Contact := nil;
    132150end;
  • trunk/Forms/UFormContacts.pas

    r14 r15  
    101101begin
    102102  Core.PersistentForm1.Load(Self);
     103  Core.ThemeManager1.UseTheme(Self);
    103104  ReloadList;
    104105  UpdateInterface;
  • trunk/Forms/UFormMain.lfm

    r14 r15  
    55  Width = 785
    66  Caption = 'vCard Studio'
    7   ClientHeight = 497
     7  ClientHeight = 506
    88  ClientWidth = 785
     9  DesignTimePPI = 120
    910  Menu = MainMenu1
    1011  OnClose = FormClose
     
    1213  OnCreate = FormCreate
    1314  OnShow = FormShow
    14   LCLVersion = '1.8.0.4'
     15  LCLVersion = '1.8.0.6'
    1516  object CoolBar1: TCoolBar
    1617    Left = 0
    17     Height = 32
     18    Height = 38
    1819    Top = 0
    1920    Width = 785
     
    3536      AnchorSideTop.Control = CoolBar1
    3637      Left = 24
    37       Height = 28
     38      Height = 22
    3839      Top = 5
    39       Width = 132
     40      Width = 105
    4041      Align = alNone
    4142      AutoSize = True
     
    5556      end
    5657      object ToolButton2: TToolButton
    57         Left = 30
     58        Left = 24
    5859        Top = 0
    5960        Action = Core.AFileOpen
     
    6263      end
    6364      object ToolButton3: TToolButton
    64         Left = 74
     65        Left = 59
    6566        Top = 0
    6667        Action = Core.AFileSave
    6768      end
    6869      object ToolButton4: TToolButton
    69         Left = 103
     70        Left = 82
    7071        Top = 0
    7172        Action = Core.AFileClose
     
    7677      AnchorSideTop.Control = CoolBar1
    7778      Left = 188
    78       Height = 28
     79      Height = 22
    7980      Top = 5
    80       Width = 30
     81      Width = 24
    8182      Align = alNone
    8283      AutoSize = True
     
    99100  object StatusBar1: TStatusBar
    100101    Left = 0
    101     Height = 30
    102     Top = 467
     102    Height = 28
     103    Top = 478
    103104    Width = 785
    104105    Panels = <   
  • trunk/Forms/UFormMain.pas

    r14 r15  
    9393begin
    9494  Core.Initialize;
     95  Core.ThemeManager1.UseTheme(Self);
    9596  Core.PersistentForm1.Load(Self);
    9697  FormContacts.ManualDock(Self, nil, alClient);
  • trunk/Forms/UFormSettings.lfm

    r1 r15  
    6363  end
    6464  object SpinEditDPI: TSpinEdit
    65     Left = 152
     65    Left = 160
    6666    Height = 28
    6767    Top = 144
     
    9797    Anchors = [akLeft, akRight, akBottom]
    9898  end
     99  object Label2: TLabel
     100    Left = 20
     101    Height = 20
     102    Top = 184
     103    Width = 48
     104    Caption = 'Theme:'
     105    ParentColor = False
     106  end
     107  object ComboBoxTheme: TComboBox
     108    Left = 160
     109    Height = 28
     110    Top = 184
     111    Width = 260
     112    ItemHeight = 20
     113    Style = csDropDownList
     114    TabOrder = 6
     115  end
    99116end
  • trunk/Forms/UFormSettings.pas

    r1 r15  
    2020    CheckBoxAutomaticDPI: TCheckBox;
    2121    ComboBoxLanguage: TComboBox;
     22    ComboBoxTheme: TComboBox;
    2223    Label1: TLabel;
     24    Label2: TLabel;
    2325    LabelDPI: TLabel;
    2426    SpinEditDPI: TSpinEdit;
     
    3941  FormSettings: TFormSettings;
    4042
     43
    4144implementation
    4245
     
    4447
    4548uses
    46   UCore;
     49  UCore, UTheme;
    4750
    4851{ TFormSettings }
     
    5356  ComboBoxLanguage.ItemIndex := ComboBoxLanguage.Items.IndexOfObject(Core.CoolTranslator1.Language);
    5457  if ComboBoxLanguage.ItemIndex = -1 then ComboBoxLanguage.ItemIndex := 0;
     58
     59  Core.ThemeManager1.Themes.LoadToStrings(ComboBoxTheme.Items);
     60  ComboBoxTheme.ItemIndex := ComboBoxTheme.Items.IndexOfObject(Core.ThemeManager1.Theme);
     61  if ComboBoxTheme.ItemIndex = -1 then ComboBoxTheme.ItemIndex := 0;
    5562end;
    5663
     
    5865begin
    5966  if ComboBoxLanguage.ItemIndex <> -1 then
    60     Core.CoolTranslator1.Language := TLanguage(ComboBoxLanguage.Items.Objects[ComboBoxLanguage.ItemIndex]);
     67    Core.CoolTranslator1.Language := TLanguage(ComboBoxLanguage.Items.Objects[ComboBoxTheme.ItemIndex]);
     68  if ComboBoxTheme.ItemIndex <> -1 then
     69    Core.ThemeManager1.Theme := TTheme(ComboBoxTheme.Items.Objects[ComboBoxTheme.ItemIndex]);
    6170end;
    6271
     
    7483begin
    7584  Core.CoolTranslator1.TranslateComponentRecursive(Self);
     85  Core.ThemeManager1.UseTheme(Self);
    7686end;
    7787
Note: See TracChangeset for help on using the changeset viewer.