Changeset 249 for trunk/Forms


Ignore:
Timestamp:
Sep 22, 2018, 9:37:16 PM (6 years ago)
Author:
chronos
Message:
  • Fixed: Use different interface language if installed as deb Linux package.
  • Fixed: Propagate status bar, toolbar visibilit, and toolbar icons size to client form.
Location:
trunk/Forms
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UFormClient.lfm

    r245 r249  
    124124      Caption = 'Toolbar big icons'
    125125      OnExecute = AToolBarBigIconsExecute
     126      OnUpdate = AToolBarBigIconsUpdate
    126127    end
    127128    object AToolBarVisible: TAction
    128129      Caption = 'Toolbar visible'
    129130      OnExecute = AToolBarVisibleExecute
     131      OnUpdate = AToolBarVisibleUpdate
    130132    end
    131133    object AStatusBarVisible: TAction
    132134      Caption = 'Statusbar visible'
    133135      OnExecute = AStatusBarVisibleExecute
     136      OnUpdate = AStatusBarVisibleUpdate
    134137    end
    135138    object AGameEndTurn: TAction
  • trunk/Forms/UFormClient.pas

    r248 r249  
    88  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ExtCtrls,
    99  UGame, LCLType, Menus, ActnList, ComCtrls, dateutils, XMLConf, DOM, Math,
    10   UGeometry, UGameClient, UGameProtocol, UThreading, UPlayer, UClientGUI;
     10  UGeometry, UGameClient, UGameProtocol, UThreading, UPlayer, UClientGUI, UFormMain;
    1111
    1212const
     
    4444    procedure AGameEndTurnExecute(Sender: TObject);
    4545    procedure AStatusBarVisibleExecute(Sender: TObject);
     46    procedure AStatusBarVisibleUpdate(Sender: TObject);
    4647    procedure ASurrenderExecute(Sender: TObject);
    4748    procedure AToolBarBigIconsExecute(Sender: TObject);
     49    procedure AToolBarBigIconsUpdate(Sender: TObject);
    4850    procedure AToolBarVisibleExecute(Sender: TObject);
     51    procedure AToolBarVisibleUpdate(Sender: TObject);
    4952    procedure AZoomAllExecute(Sender: TObject);
    5053    procedure AZoomInExecute(Sender: TObject);
     
    9295    procedure DoClientDestroy(Sender: TObject);
    9396  public
     97    FormMain: TFormMain;
    9498    procedure LoadConfig(Config: TXmlConfig; Path: string);
    9599    procedure SaveConfig(Config: TXmlConfig; Path: string);
     
    416420begin
    417421  AToolBarBigIcons.Checked := not AToolBarBigIcons.Checked;
     422end;
     423
     424procedure TFormClient.AToolBarBigIconsUpdate(Sender: TObject);
     425begin
    418426  UpdateInterface;
    419427end;
     
    422430begin
    423431  AStatusBarVisible.Checked := not AStatusBarVisible.Checked;
     432  UpdateInterface;
     433end;
     434
     435procedure TFormClient.AStatusBarVisibleUpdate(Sender: TObject);
     436begin
    424437  UpdateInterface;
    425438end;
     
    444457begin
    445458  AToolBarVisible.Checked := not AToolBarVisible.Checked;
     459  UpdateInterface;
     460end;
     461
     462procedure TFormClient.AToolBarVisibleUpdate(Sender: TObject);
     463begin
    446464  UpdateInterface;
    447465end;
  • trunk/Forms/UFormMain.lfm

    r243 r249  
    11object FormMain: TFormMain
    2   Left = 801
     2  Left = 826
    33  Height = 621
    4   Top = 352
     4  Top = 419
    55  Width = 775
    66  Caption = 'xTactics'
    7   ClientHeight = 596
     7  ClientHeight = 587
    88  ClientWidth = 775
    9   DesignTimePPI = 120
     9  DesignTimePPI = 144
    1010  Menu = MainMenu1
    1111  OnActivate = FormActivate
     
    7979  object PanelMain: TPanel
    8080    Left = 0
    81     Height = 556
     81    Height = 547
    8282    Top = 40
    8383    Width = 775
     
    147147      end
    148148      object MenuItem22: TMenuItem
    149         Caption = 'Statusbar visible'
     149        Action = AStatusBarVisible
    150150      end
    151151      object MenuItem26: TMenuItem
     
    208208      OnExecute = AToolBarVisibleExecute
    209209    end
     210    object AStatusBarVisible: TAction
     211      Caption = 'Status bar visible'
     212      OnExecute = AStatusBarVisibleExecute
     213    end
    210214  end
    211215  object PopupMenuToolbar: TPopupMenu
  • trunk/Forms/UFormMain.pas

    r243 r249  
    1818
    1919  TFormMain = class(TForm)
     20    AStatusBarVisible: TAction;
    2021    AToolBarVisible: TAction;
    2122    AToolBarBigIcons: TAction;
     
    6768    ToolButton5: TToolButton;
    6869    ToolButton9: TToolButton;
     70    procedure AStatusBarVisibleExecute(Sender: TObject);
    6971    procedure AToolBarBigIconsExecute(Sender: TObject);
    7072    procedure AToolBarVisibleExecute(Sender: TObject);
     
    8082    FormActivated: Boolean;
    8183    procedure ApplicationStart(Ptr: IntPtr);
     84    procedure UpdateClientForms;
    8285  public
    8386    procedure LoadConfig(Config: TXmlConfig; Path: string);
     
    121124    AToolBarBigIcons.Checked := GetValue(DOMString(Path + '/LargeIcons'), False);
    122125    AToolBarVisible.Checked := GetValue(DOMString(Path + '/ToolBarVisible'), True);
     126    AStatusBarVisible.Checked := GetValue(DOMString(Path + '/StatusBarVisible'), False);
    123127  end;
    124128end;
     
    129133    SetValue(DOMString(Path + '/LargeIcons'), AToolBarBigIcons.Checked);
    130134    SetValue(DOMString(Path + '/ToolBarVisible'), AToolBarVisible.Checked);
     135    SetValue(DOMString(Path + '/StatusBarVisible'), AStatusBarVisible.Checked);
    131136  end;
    132137end;
     
    164169end;
    165170
     171procedure TFormMain.AStatusBarVisibleExecute(Sender: TObject);
     172begin
     173  AStatusBarVisible.Checked := not AStatusBarVisible.Checked;
     174  UpdateClientForms;
     175end;
     176
    166177procedure TFormMain.AToolBarBigIconsExecute(Sender: TObject);
    167178begin
    168179  AToolBarBigIcons.Checked := not AToolBarBigIcons.Checked;
    169180  ReloadView;
     181  UpdateClientForms;
    170182end;
    171183
     
    174186  AToolBarVisible.Checked := not AToolBarVisible.Checked;
    175187  ReloadView;
     188  UpdateClientForms;
    176189end;
    177190
     
    206219begin
    207220  Core.ReopenGameOnInit;
     221end;
     222
     223procedure TFormMain.UpdateClientForms;
     224var
     225  I: Integer;
     226begin
     227  FormClient.AToolBarBigIcons.Checked := AToolBarBigIcons.Checked;
     228  FormClient.AToolBarBigIcons.Update;
     229  FormClient.AToolBarVisible.Checked := AToolBarVisible.Checked;
     230  FormClient.AToolBarVisible.Update;
     231  FormClient.AStatusBarVisible.Checked := AStatusBarVisible.Checked;
     232  FormClient.AStatusBarVisible.Update;
     233  for I := 0 to Core.FormClients.Count - 1 do begin
     234    Core.FormClients[I].AToolBarBigIcons.Checked := AToolBarBigIcons.Checked;
     235    Core.FormClients[I].AToolBarBigIcons.Update;
     236    Core.FormClients[I].AToolBarVisible.Checked := AToolBarVisible.Checked;
     237    Core.FormClients[I].AToolBarVisible.Update;
     238    Core.FormClients[I].AStatusBarVisible.Checked := AStatusBarVisible.Checked;
     239    Core.FormClients[I].AStatusBarVisible.Update;
     240  end;
    208241end;
    209242
     
    218251  ReloadView;
    219252  FormClient.Show;
     253  UpdateClientForms;
    220254  Application.QueueAsyncCall(ApplicationStart, 0);
    221255end;
Note: See TracChangeset for help on using the changeset viewer.