Changeset 458


Ignore:
Timestamp:
Feb 17, 2023, 2:14:04 PM (2 years ago)
Author:
ataylor
Message:

Update ConfigApps to use dynamic font size & scaling, version set to 1.2.1.
Added SetColumnWidth method to MultiColumnListBox control.

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Components/MultiColumnListBox.pas

    r396 r458  
    3838    function GetParentColor: boolean;
    3939    function GetParentShowHint: boolean;
    40     function GetThePopupMenu: TPopupMenu; 
     40    function GetThePopupMenu: TPopupMenu;
    4141    function GetShowHint: boolean;
    4242//    procedure SetEnabled(NewState:Boolean); override;
     
    117117    property Selected[ Index: longint ]: boolean read GetSelected write SetSelected;
    118118
     119    procedure SetColumnWidth( const Index: Integer;
     120                              const NewWidth: Integer );
     121
    119122    property Parent;
    120123
     
    176179uses
    177180  StringUtilsUnit;
    178  
     181
    179182{ TMultiColumnListBox }
    180183
     
    455458end;
    456459
     460procedure TMultiColumnListBox.SetColumnWidth( const Index: Integer;
     461                                              const NewWidth: Integer );
     462begin
     463  FHeader.Sections[ Index ].Width := NewWidth;
     464  Layout;
     465  Invalidate;
     466end;
     467
    457468procedure TMultiColumnListBox.Notification( AComponent: TComponent;
    458469                                            Operation: TOperation);
     
    603614begin
    604615  FHeader.Height := Value;
     616  Layout;
    605617end;
    606618
  • trunk/ConfigApps/MainFormUnit.pas

    r416 r458  
    77
    88const
    9   AppVersion = 'V1.2.0'; // $SS_REQUIRE_NEW_VERSION$
     9  AppVersion = 'V1.2.1'; // $SS_REQUIRE_NEW_VERSION$
    1010
    1111type
     
    4949    LngDirectoryDoesNotExist: String;
    5050    LngSaveAnyway: String;
     51    Procedure MainFormOnSetupShow (Sender: TObject);
    5152    Procedure ParametersEditOnChange (Sender: TObject);
    5253    Procedure RestoreButtonOnClick (Sender: TObject);
     
    183184                                  '' );
    184185end;
     186
     187Procedure TMainForm.MainFormOnSetupShow (Sender: TObject);
     188Begin
     189  ScaleForm( self, 7, 14 );
     190  ItemsListBox.SetColumnWidth( 0, trunc( Width * 0.3 ));
     191End;
    185192
    186193Procedure TMainForm.ParametersEditOnChange (Sender: TObject);
     
    354361  Bottom := ( Screen.Height - Height ) div 2;
    355362
     363  ItemsListBox.ItemHeight := Font.Height + 2;
     364  ItemsListBox.HeaderHeight := Font.Height + 2;
     365
    356366end;
    357367
Note: See TracChangeset for help on using the changeset viewer.