TvPlanIt: Workaround for opaque labels issue in Laz 2.2.4.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@8692 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2023-01-18 10:55:52 +00:00
parent 19b469917e
commit 98b7bb2e30
26 changed files with 83 additions and 84 deletions

View File

@ -721,41 +721,41 @@ object MainForm: TMainForm
DrawingStyle = dsCoolTab
FolderCollection = <
item
Version = 'v1.0.7'
Version = 'v1.7.0'
Caption = 'Planner'
Enabled = True
FolderType = ftDefault
ItemCollection = <
item
Version = 'v1.0.7'
Version = 'v1.7.0'
Caption = 'Events'
IconIndex = 0
Name = 'NIEvents'
Tag = 0
end
item
Version = 'v1.0.7'
Version = 'v1.7.0'
Caption = 'Month view'
IconIndex = 5
Name = 'NIEventsByMonth'
Tag = 0
end
item
Version = 'v1.0.7'
Version = 'v1.7.0'
Caption = 'Week view'
IconIndex = 4
Name = 'NIEventsByWeek'
Tag = 0
end
item
Version = 'v1.0.7'
Version = 'v1.7.0'
Caption = 'Day view'
IconIndex = 3
Name = 'NIEventsByDay'
Tag = 0
end
item
Version = 'v1.0.7'
Version = 'v1.7.0'
Caption = 'Tasks'
Description = 'Show tasks'
IconIndex = 1
@ -763,7 +763,7 @@ object MainForm: TMainForm
Tag = 0
end
item
Version = 'v1.0.7'
Version = 'v1.7.0'
Caption = 'Contacts'
Description = 'Show address book'
IconIndex = 2
@ -775,20 +775,20 @@ object MainForm: TMainForm
Tag = 0
end
item
Version = 'v1.0.7'
Version = 'v1.7.0'
Caption = 'Maintenance'
Enabled = True
FolderType = ftDefault
ItemCollection = <
item
Version = 'v1.0.7'
Version = 'v1.7.0'
Caption = 'Resources'
IconIndex = 7
Name = 'NIResources'
Tag = 0
end
item
Version = 'v1.0.7'
Version = 'v1.7.0'
Caption = 'Settings'
IconIndex = 8
Name = 'NISettings'
@ -825,12 +825,12 @@ object MainForm: TMainForm
Printer.MarginUnits = imPercent
Printer.PrintFormats = <
item
Version = 'v1.0.7'
Version = 'v1.7.0'
DayInc = 0
DayIncUnits = duDay
Elements = <
item
Version = 'v1.0.7'
Version = 'v1.7.0'
Caption.Caption = 'Current week'
Caption.Font.Style = [fsItalic]
DayOffset = 0
@ -845,12 +845,12 @@ object MainForm: TMainForm
FormatName = 'Events of current week (Day view)'
end
item
Version = 'v1.0.7'
Version = 'v1.7.0'
DayInc = 0
DayIncUnits = duWeek
Elements = <
item
Version = 'v1.0.7'
Version = 'v1.7.0'
DayOffset = 0
DayOffsetUnits = duDay
ElementName = 'WeekView'
@ -864,12 +864,12 @@ object MainForm: TMainForm
FormatName = 'Events of current week (Week view)'
end
item
Version = 'v1.0.7'
Version = 'v1.7.0'
DayInc = 0
DayIncUnits = duDay
Elements = <
item
Version = 'v1.0.7'
Version = 'v1.7.0'
DayOffset = 0
DayOffsetUnits = duWeek
ElementName = 'TaskList'
@ -883,12 +883,12 @@ object MainForm: TMainForm
FormatName = 'Tasks of current week'
end
item
Version = 'v1.0.7'
Version = 'v1.7.0'
DayInc = 0
DayIncUnits = duDay
Elements = <
item
Version = 'v1.0.7'
Version = 'v1.7.0'
DayOffset = 0
DayOffsetUnits = duDay
ElementName = 'TaskList'
@ -903,12 +903,12 @@ object MainForm: TMainForm
FormatName = 'Tasks of current week (landscape)'
end
item
Version = 'v1.0.7'
Version = 'v1.7.0'
DayInc = 1
DayIncUnits = duWeek
Elements = <
item
Version = 'v1.0.7'
Version = 'v1.7.0'
DayOffset = 0
DayOffsetUnits = duDay
ElementName = 'WeekView'
@ -928,7 +928,7 @@ object MainForm: TMainForm
Top = 200
end
object VpResourceEditDialog1: TVpResourceEditDialog
Version = 'v1.0.7'
Version = 'v1.7.0'
Options = []
Placement.Position = mpCenter
Placement.Top = 10
@ -1350,7 +1350,7 @@ object MainForm: TMainForm
Top = 344
end
object VpPrintPreviewDialog1: TVpPrintPreviewDialog
Version = 'v1.0.7'
Version = 'v1.7.0'
ControlLink = VpControlLink1
EndDate = 42561.5151169907
MarginUnits = imPercent
@ -1365,7 +1365,7 @@ object MainForm: TMainForm
Top = 432
end
object VpPrintFormatEditDialog1: TVpPrintFormatEditDialog
Version = 'v1.0.7'
Version = 'v1.7.0'
ControlLink = VpControlLink1
Options = []
Placement.Position = mpCenter

View File

@ -673,6 +673,8 @@ begin
// Fix TLabel transparency issue of Laz 2.2+
for i := 0 to ComponentCount-1 do
if Components[i] is TLabel then TLabel(Components[i]).Transparent := true;
FixLabels(self);
end;
procedure TMainForm.FormDestroy(Sender: TObject);

View File

@ -15,6 +15,7 @@ object AlarmNotifyForm: TAlarmNotifyForm
OnCreate = FormCreate
OnKeyDown = FormKeyDown
OnShow = FormShow
LCLVersion = '2.3.0.0'
object SnoozeCaption: TLabel
AnchorSideLeft.Control = lTime
AnchorSideTop.Control = Bevel1
@ -29,7 +30,6 @@ object AlarmNotifyForm: TAlarmNotifyForm
BorderSpacing.Right = 8
BorderSpacing.Bottom = 8
Caption = 'SnoozeCaption'
Color = clDefault
Constraints.MinWidth = 200
ParentColor = False
end
@ -43,7 +43,6 @@ object AlarmNotifyForm: TAlarmNotifyForm
Width = 45
BorderSpacing.Top = 4
Caption = 'lSubject'
Color = clDefault
Font.Style = [fsBold]
ParentColor = False
ParentFont = False
@ -58,7 +57,6 @@ object AlarmNotifyForm: TAlarmNotifyForm
BorderSpacing.Left = 8
BorderSpacing.Top = 8
Caption = 'lTime'
Color = clDefault
ParentColor = False
end
object DismissBtn: TButton
@ -163,7 +161,6 @@ object AlarmNotifyForm: TAlarmNotifyForm
BorderSpacing.Top = 8
BorderSpacing.Right = 8
Caption = 'lNotes'
Color = clDefault
ParentColor = False
WordWrap = True
end
@ -182,7 +179,7 @@ object AlarmNotifyForm: TAlarmNotifyForm
Shape = bsTopLine
end
object EventDialog: TVpEventEditDialog
Version = 'v1.0.7'
Version = 'v1.7.0'
TimeFormat = tf24Hour
Options = []
Placement.Position = mpCenterTop

View File

@ -115,8 +115,6 @@ begin
FPlacement.Position := mpCustom;
FPlacement.Width := 412;
end;
{=====}
procedure TVpNotificationDialog.Execute(Event: TVpEvent);
var
@ -143,7 +141,7 @@ begin
end;
end;
end;
{=====}
{ TAlarmNotifyForm }
@ -199,8 +197,6 @@ begin
ShowTime := Now;
end;
end;
{=====}
procedure TAlarmNotifyForm.SnoozeComboChange(Sender: TObject);
begin
@ -228,14 +224,12 @@ begin
20: SnoozeDelay := 7.0; {1 week }
end;
end;
{=====}
procedure TAlarmNotifyForm.SnoozeBtnClick(Sender: TObject);
begin
CalcSnooze;
Close;
end;
{=====}
procedure TAlarmNotifyForm.DismissBtnClick(Sender: TObject);
var
@ -268,11 +262,9 @@ end;
procedure TAlarmNotifyForm.FormCreate(Sender: TObject);
begin
// SnoozeCombo.Top := SnoozeBtn.Top + (SnoozeBtn.Height - SnoozeCombo.Height) div 2;
FixLabels(Self);
end;
{=====}
procedure TAlarmNotifyForm.OpenItemBtnClick(Sender: TObject);
begin
Self.Hide;
@ -280,7 +272,6 @@ begin
EventDialog.Execute(Event);
Close;
end;
{=====}
procedure TAlarmNotifyForm.FormKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
@ -291,13 +282,11 @@ begin
Close;
end;
end;
{=====}
procedure TAlarmNotifyForm.CalcSnooze;
begin
Event.SnoozeTime := Now + SnoozeDelay;
end;
{=====}
procedure TAlarmNotifyForm.FormShow(Sender: TObject);
begin

View File

@ -13,7 +13,7 @@ object ContactEditForm: TContactEditForm
OnKeyDown = FormKeyDown
OnShow = FormShow
Position = poScreenCenter
LCLVersion = '1.9.0.0'
LCLVersion = '2.3.0.0'
object PageControl: TPageControl
Left = 0
Height = 577
@ -97,10 +97,10 @@ object ContactEditForm: TContactEditForm
AnchorSideTop.Control = edTitle
AnchorSideTop.Side = asrCenter
AnchorSideRight.Control = edTitle
Left = 75
Left = 76
Height = 15
Top = 66
Width = 23
Width = 22
Alignment = taRightJustify
Anchors = [akTop, akRight]
BorderSpacing.Left = 8

View File

@ -205,6 +205,7 @@ procedure TContactEditForm.FormCreate(Sender: TObject);
begin
ReturnCode := rtAbandon;
SetCaptions;
FixLabels(Self);
end;
procedure TContactEditForm.SetCaptions;

View File

@ -182,6 +182,7 @@ begin
gbPosition.Font.Style := [fsBold];
SetCaptions;
FixLabels(Self);
end;
procedure TfrmEditElement.FormShow(Sender: TObject);

View File

@ -13,6 +13,7 @@ object frmEditFormat: TfrmEditFormat
OnCreate = FormCreate
OnShow = FormShow
Position = poScreenCenter
LCLVersion = '2.3.0.0'
object Panel1: TPanel
Left = 8
Height = 148
@ -39,7 +40,6 @@ object frmEditFormat: TfrmEditFormat
BorderSpacing.Left = 8
BorderSpacing.Right = 8
Caption = 'Name: '
Color = clDefault
FocusControl = edName
ParentColor = False
end
@ -55,7 +55,6 @@ object frmEditFormat: TfrmEditFormat
BorderSpacing.Left = 8
BorderSpacing.Right = 8
Caption = 'Day Increment:'
Color = clDefault
FocusControl = edIncrement
ParentColor = False
end
@ -71,7 +70,6 @@ object frmEditFormat: TfrmEditFormat
BorderSpacing.Left = 8
BorderSpacing.Right = 8
Caption = 'Description: '
Color = clDefault
FocusControl = edDescription
ParentColor = False
end

View File

@ -123,6 +123,7 @@ end;
procedure TfrmEditFormat.FormCreate(Sender: TObject);
begin
SetCaptions;
FixLabels(Self);
end;
procedure TfrmEditFormat.SaveData(AFormat: TVpPrintFormatItem);

View File

@ -21,7 +21,6 @@ object frmPrnFormat: TfrmPrnFormat
BorderSpacing.Left = 6
BorderSpacing.Top = 8
Caption = '&Formats:'
Color = clDefault
FocusControl = lbFormats
ParentColor = False
end
@ -35,7 +34,6 @@ object frmPrnFormat: TfrmPrnFormat
Width = 51
BorderSpacing.Top = 8
Caption = 'Ele&ments:'
Color = clDefault
FocusControl = lbElements
ParentColor = False
end
@ -80,7 +78,6 @@ object frmPrnFormat: TfrmPrnFormat
Alignment = taCenter
Anchors = [akLeft, akBottom]
Caption = 'Print'#13#10'Order'
Color = clDefault
ParentColor = False
WordWrap = True
end
@ -306,7 +303,6 @@ object frmPrnFormat: TfrmPrnFormat
Width = 44
BorderSpacing.Left = 4
Caption = 'Preview:'
Color = clDefault
ParentColor = False
end
object PrintPreview: TVpPrintPreview

View File

@ -174,6 +174,7 @@ begin
EnableElementButtons(False);
SetCaptions;
FixLabels(Self);
end;
procedure TfrmPrnFormat.EnableMoveButtons;

View File

@ -15,7 +15,7 @@ object frmEditShape: TfrmEditShape
OnShow = FormShow
Position = poScreenCenter
ShowHint = True
LCLVersion = '1.6.4.0'
LCLVersion = '2.3.0.0'
object gbBrush: TGroupBox
AnchorSideLeft.Control = gbPen
AnchorSideLeft.Side = asrBottom
@ -221,7 +221,6 @@ object frmEditShape: TfrmEditShape
Min = 0
Position = 0
TabOrder = 3
Wrap = False
end
object edPenWidth: TEdit
AnchorSideLeft.Control = cbPenStyle

View File

@ -382,6 +382,7 @@ begin
UpdateBitmaps;
SetCaptions;
FixLabels(Self);
end;
procedure TfrmEditShape.FormDestroy(Sender: TObject);

View File

@ -11,6 +11,7 @@ object DlgEventEdit: TDlgEventEdit
OnCreate = FormCreate
OnShow = FormShow
Position = poScreenCenter
LCLVersion = '2.3.0.0'
object ButtonPanel: TPanel
Left = 0
Height = 37
@ -32,7 +33,6 @@ object DlgEventEdit: TDlgEventEdit
Width = 88
BorderSpacing.Left = 12
Caption = 'Resource Name'
Color = clDefault
Font.CharSet = ANSI_CHARSET
Font.Color = clMaroon
Font.Style = [fsBold]
@ -134,7 +134,6 @@ object DlgEventEdit: TDlgEventEdit
BorderSpacing.Left = 12
BorderSpacing.Right = 8
Caption = 'Description:'
Color = clDefault
ParentColor = False
end
object DescriptionEdit: TEdit
@ -161,7 +160,6 @@ object DlgEventEdit: TDlgEventEdit
Anchors = [akTop, akRight]
BorderSpacing.Right = 8
Caption = 'Location:'
Color = clDefault
FocusControl = LocationEdit
ParentColor = False
end
@ -192,7 +190,6 @@ object DlgEventEdit: TDlgEventEdit
BorderSpacing.Left = 12
BorderSpacing.Right = 12
Caption = 'Category:'
Color = clDefault
ParentColor = False
end
object Category: TComboBox
@ -248,7 +245,6 @@ object DlgEventEdit: TDlgEventEdit
Anchors = [akTop, akRight]
BorderSpacing.Right = 8
Caption = 'Start:'
Color = clDefault
ParentColor = False
end
object EndTimeLbl: TLabel
@ -264,7 +260,6 @@ object DlgEventEdit: TDlgEventEdit
Anchors = [akTop, akRight]
BorderSpacing.Right = 8
Caption = 'End:'
Color = clDefault
ParentColor = False
end
object StartDate: TDateEdit
@ -410,7 +405,6 @@ object DlgEventEdit: TDlgEventEdit
Width = 136
BorderSpacing.Left = 12
Caption = 'Appointment Recurrence:'
Color = clDefault
ParentColor = False
end
object RecurringType: TComboBox
@ -440,7 +434,6 @@ object DlgEventEdit: TDlgEventEdit
Anchors = [akTop, akRight]
BorderSpacing.Left = 36
Caption = 'Interval (days):'
Color = clDefault
ParentColor = False
end
object CustomInterval: TEdit

View File

@ -275,6 +275,8 @@ begin
Category.DropDownCount := DROPDOWN_COUNT;
Category.ItemHeight := LocationEdit.Height - 4;
FixLabels(self);
end;
{=====}

View File

@ -12,7 +12,7 @@ object frmFieldMapper: TfrmFieldMapper
OnClose = FormClose
OnShow = FormShow
Position = poScreenCenter
LCLVersion = '1.6.4.0'
LCLVersion = '2.3.0.0'
object ButtonPanel: TPanel
Left = 0
Height = 35

View File

@ -248,6 +248,7 @@ end;
procedure TfrmFieldMapper.FormShow(Sender: TObject);
begin
FixLabels(Self);
PositionControls;
DatasetCombo.Items.Clear;

View File

@ -35,7 +35,7 @@ interface
uses
{$IFDEF LCL}
LCLProc, LCLType, LCLIntf,
LCLProc, LCLType, LCLIntf, LCLVersion,
{$ELSE}
Windows, Consts, Messages,
{$ENDIF}
@ -207,6 +207,8 @@ procedure LoadImageFromRCDATA(AImage: TImage; ABaseResName: String;
function GetScrollbarHeight: Integer;
function GetScrollbarWidth: Integer;
procedure FixLabels(AForm: TCustomForm);
procedure Unused(const A1); overload;
procedure Unused(const A1, A2); overload;
procedure Unused(const A1, A2, A3); overload;
@ -1281,6 +1283,20 @@ begin
Result := GetSystemMetrics(SM_CXVSCROLL);
end;
{ Fix label transparency issue in Laz v2.2.4 }
procedure FixLabels(AForm: TCustomForm);
{$IF LCL_FullVersion = 2020400}
var
i: Integer;
{$IFEND}
begin
{$IF LCL_FullVersion = 2020400}
for i := 0 to AForm.ControlCount-1 do
if AForm.Controls[i] is TLabel
then TLabel(AForm.Controls[i]).Transparent := true;
{$IFEND}
end;
{$PUSH}{$HINTS OFF}
procedure Unused(const A1);
begin

View File

@ -183,6 +183,7 @@ begin
Toolbar1.ButtonHeight := ScaleY(Toolbar1.ButtonHeight, DesignTimeDPI);
{$IFEND}
Toolbar1.ButtonWidth := Toolbar1.ButtonHeight;
FixLabels(Self);
end;
procedure TfrmPrintPreview.PopulateImageList;

View File

@ -79,7 +79,6 @@ object ResEditForm: TResEditForm
Width = 63
BorderSpacing.Left = 8
Caption = 'Description:'
Color = clDefault
ParentColor = False
end
object lblNotes: TLabel
@ -92,7 +91,6 @@ object ResEditForm: TResEditForm
Width = 34
BorderSpacing.Top = 8
Caption = 'Notes:'
Color = clDefault
ParentColor = False
end
object imgResources: TImage

View File

@ -259,6 +259,7 @@ procedure TResEditForm.FormCreate(Sender: TObject);
begin
ReturnCode := rtAbandon;
ResourceChanged := false;
FixLabels(Self);
end;
{=====}

View File

@ -8,8 +8,9 @@ object frmSelectResource: TfrmSelectResource
Caption = 'Select a Resource'
ClientHeight = 162
ClientWidth = 274
OnCreate = FormCreate
Position = poDesktopCenter
LCLVersion = '1.6.4.0'
LCLVersion = '2.3.0.0'
object Bevel1: TBevel
Left = 8
Height = 105
@ -70,14 +71,14 @@ object frmSelectResource: TfrmSelectResource
TabOrder = 2
end
object VpResourceEditDialog1: TVpResourceEditDialog
Version = 'v1.05'
Version = 'v1.7.0'
Options = []
Placement.Position = mpCenter
Placement.Top = 10
Placement.Left = 10
Placement.Height = 250
Placement.Width = 400
left = 232
top = 16
Left = 232
Top = 16
end
end

View File

@ -37,9 +37,12 @@ uses
Windows, Messages,
{$ENDIF}
SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, ExtCtrls,
VpBaseDS, VpResEditDlg;
VpMisc, VpBaseDS, VpResEditDlg;
type
{ TfrmSelectResource }
TfrmSelectResource = class(TForm)
VpResourceCombo1: TVpResourceCombo;
lblSelectResource: TLabel;
@ -51,6 +54,7 @@ type
Bevel1: TBevel;
procedure btnAddNewClick(Sender: TObject);
procedure btnEditClick(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
@ -78,5 +82,10 @@ begin
VpResourceEditDialog1.Execute;
end;
procedure TfrmSelectResource.FormCreate(Sender: TObject);
begin
FixLabels(Self);
end;
end.

View File

@ -11,7 +11,7 @@ object TaskEditForm: TTaskEditForm
OnCreate = FormCreate
OnShow = FormShow
Position = poScreenCenter
LCLVersion = '1.6.4.0'
LCLVersion = '2.3.0.0'
object ButtonPanel: TPanel
Left = 0
Height = 33
@ -307,7 +307,7 @@ object TaskEditForm: TTaskEditForm
Left = 358
Height = 19
Top = 66
Width = 72
Width = 70
BorderSpacing.Right = 4
Caption = 'Complete'
TabOrder = 2

View File

@ -127,8 +127,7 @@ uses
procedure TTaskEditForm.FormCreate(Sender: TObject);
begin
FReturnCode := rtAbandon;
// FBtnHeight := ScaleY(OKBtn.Height, DesignTimeDPI);
// FEditHeight := ScaleY(DueDateEdit.Height, DesignTimeDPI);
FixLabels(Self);
end;
procedure TTaskEditForm.DePopulateSelf;
@ -139,9 +138,7 @@ begin
Task.Complete := CbComplete.Checked;
Task.Priority := CbPriority.ItemIndex-1;
Task.Category := CbCategory.ItemIndex;
// DueDateLbl.Caption := RSDueDateLabel;
end;
{=====}
procedure TTaskEditForm.SetCaptions;
var
@ -237,34 +234,29 @@ begin
AutoSize := true;
end;
{=====}
procedure TTaskEditForm.OnChange(Sender: TObject);
begin
Task.Changed := true;
end;
{=====}
procedure TTaskEditForm.OKBtnClick(Sender: TObject);
begin
FReturnCode := rtCommit;
Close;
end;
{=====}
procedure TTaskEditForm.CancelBtnClick(Sender: TObject);
begin
Close;
end;
{=====}
procedure TTaskEditForm.FormShow(Sender: TObject);
begin
PositionControls;
DescriptionEdit.SetFocus;
end;
{=====}
{ TVpTaskEditDialog }
@ -303,7 +295,6 @@ begin
end;
end;
end;
{=====}
function TVpTaskEditDialog.AddNewTask: Boolean;
begin
@ -317,7 +308,6 @@ begin
end;
end;
end;
{=====}
end.

View File

@ -138,6 +138,7 @@ begin
{$IFDEF NEW_ICONS}
LoadGlyphFromRCDATA(PlayBtn.Glyph, 'VpSpeaker', 16, 24, 32);
{$ENDIF}
FixLabels(Self);
end;
procedure TFrmSoundDialog.FormShow(Sender: TObject);