tvplanit: Beginning to implement borderless DrawingStyle (dsNone)

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@4899 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2016-07-02 23:14:26 +00:00
parent 1159900b4e
commit fc0fee4e00
7 changed files with 99 additions and 39 deletions

View File

@ -25,9 +25,9 @@ object MainForm: TMainForm
Height = 532
Top = 48
Width = 780
ActivePage = TabEvents
ActivePage = TabSettings
Align = alClient
TabIndex = 0
TabIndex = 4
TabOrder = 0
object TabEvents: TTabSheet
Caption = 'Events'
@ -473,15 +473,6 @@ object MainForm: TMainForm
State = cbChecked
TabOrder = 3
end
object Cb3D: TCheckBox
Left = 349
Height = 19
Top = 64
Width = 107
Caption = '3d display mode'
OnChange = Cb3DChange
TabOrder = 4
end
object LblAddressBuilder: TLabel
AnchorSideTop.Control = CbAddressBuilder
AnchorSideTop.Side = asrCenter
@ -507,9 +498,43 @@ object MainForm: TMainForm
)
OnChange = CbAddressBuilderChange
Style = csDropDownList
TabOrder = 5
TabOrder = 4
Text = '(default)'
end
object LblDrawingStyle: TLabel
Left = 349
Height = 15
Top = 68
Width = 74
Caption = 'Drawing style:'
ParentColor = False
end
object ComboBox1: TComboBox
Left = 10
Height = 23
Top = 10
Width = 100
ItemHeight = 15
TabOrder = 5
Text = 'ComboBox1'
end
object CbDrawingStyle: TComboBox
Left = 439
Height = 23
Top = 64
Width = 113
ItemHeight = 15
ItemIndex = 0
Items.Strings = (
'flat'
'3d'
'borderless'
)
OnChange = CbDrawingStyleChange
Style = csDropDownList
TabOrder = 6
Text = 'flat'
end
end
end
object HeaderPanel: TPanel

View File

@ -16,9 +16,11 @@ TMAINFORM.LBLLANGUAGE.CAPTION=Language
TMAINFORM.LBLTIMEFORMAT.CAPTION=Time format
TMAINFORM.LBLFIRSTDAYOFWEEK.CAPTION=First day of week
TMAINFORM.CBALLOWINPLACEEDITING.CAPTION=Allow inplace editing
TMAINFORM.CB3D.CAPTION=3d display mode
TMAINFORM.LBLADDRESSBUILDER.CAPTION=Address builder
TMAINFORM.CBADDRESSBUILDER.TEXT=(default)
TMAINFORM.LBLDRAWINGSTYLE.CAPTION=Drawing style:
TMAINFORM.COMBOBOX1.TEXT=ComboBox1
TMAINFORM.CBDRAWINGSTYLE.TEXT=flat
TMAINFORM.TITLELBL.CAPTION=TitleLbl
TMAINFORM.MENUITEM1.CAPTION=File
TMAINFORM.MNUQUIT.CAPTION=Quit

View File

@ -9,7 +9,7 @@ uses
StdCtrls, ComCtrls, LCLTranslator, Menus,
VpBaseDS, VpDayView, VpWeekView, VpTaskList, VpAbout,
VpContactGrid, VpMonthView, VpResEditDlg, VpContactButtons, VpBufDS, VpNavBar,
VpData;
VpData, Types;
type
@ -24,10 +24,12 @@ type
CbTimeFormat: TComboBox;
CbFirstDayOfWeek: TComboBox;
CbAllowInplaceEditing: TCheckBox;
Cb3D: TCheckBox;
CbAddressBuilder: TComboBox;
ComboBox1: TComboBox;
CbDrawingStyle: TComboBox;
Img: TImage;
ImageList1: TImageList;
LblDrawingStyle: TLabel;
LblAddressBuilder: TLabel;
LblFirstDayOfWeek: TLabel;
LblTimeFormat: TLabel;
@ -76,6 +78,7 @@ type
procedure Cb3DChange(Sender: TObject);
procedure CbAddressBuilderChange(Sender: TObject);
procedure CbAllowInplaceEditingChange(Sender: TObject);
procedure CbDrawingStyleChange(Sender: TObject);
procedure CbFirstDayOfWeekChange(Sender: TObject);
procedure CbGranularityChange(Sender: TObject);
procedure CbLanguagesChange(Sender: TObject);
@ -248,7 +251,7 @@ procedure TMainForm.Cb3DChange(Sender: TObject);
var
ds: TVpDrawingStyle;
begin
if Cb3D.Checked then ds := ds3d else ds := dsFlat;
ds := TVpDrawingStyle(CbDrawingStyle.ItemIndex);
VpTaskList1.DrawingStyle := ds;
VpContactGrid1.DrawingStyle := ds;
VpDayView1.DrawingStyle := ds;
@ -272,6 +275,18 @@ begin
VpTaskList1.AllowInplaceEditing := CbAllowInplaceEditing.Checked;
end;
procedure TMainForm.CbDrawingStyleChange(Sender: TObject);
var
ds: TVpDrawingStyle;
begin
ds := TVpDrawingStyle(CbDrawingStyle.ItemIndex);
VpTaskList1.DrawingStyle := ds;
VpContactGrid1.DrawingStyle := ds;
VpDayView1.DrawingStyle := ds;
VpWeekView1.DrawingStyle := ds;
VpMonthView1.DrawingStyle := ds;
end;
procedure TMainForm.CbFirstDayOfWeekChange(Sender: TObject);
begin
VpWeekView1.WeekStartsOn := TVpDayType(CbFirstDayOfWeek.ItemIndex);
@ -476,8 +491,8 @@ begin
CbAllowInplaceEditing.Checked := ini.ReadBool('Settings', 'AllowInplaceEditing', CbAllowInplaceEditing.Checked);
CbAllowInplaceEditingChange(nil);
Cb3D.Checked := ini.ReadBool('Settings', '3dViewstyle', false);
Cb3dChange(nil);
CbDrawingStyle.ItemIndex := ini.ReadInteger('Settings', 'DrawingStyle', CbDrawingStyle.ItemIndex);
CbDrawingStyleChange(nil);
finally
ini.Free;
@ -510,7 +525,7 @@ begin
ini.WriteInteger('Settings', 'VisibleDays', FVisibleDays);
ini.WriteBool('Settings', 'AllTasks', VpTaskList1.DisplayOptions.ShowAll);
ini.WriteBool('Settings', 'AllowInplaceEditing', CbAllowInplaceEditing.Checked);
ini.WriteBool('Settings', '3dViewStyle', Cb3D.Checked);
ini.WriteInteger('Settings', 'DrawingStyle', CbDrawingStyle.ItemIndex);
finally
ini.Free;
end;
@ -645,7 +660,8 @@ begin
CbAddressBuilder.Left := CbLanguages.Left;
LblAddressBuilder.Left := CbAddressBuilder.Left - 8 - GetLabelWidth(LblAddressBuilder);
CbAllowInplaceEditing.Left := CbLanguages.Left + CbLanguages.Width + 32;
Cb3D.Left := CbAllowInplaceEditing.Left;
LblDrawingStyle.Left := CbAllowInplaceEditing.Left;
CbDrawingStyle.Left := LblDrawingStyle.Left + GetLabelWidth(LblDrawingStyle) + 8;
RbHideCompletedTasks.Left := RbAllTasks.Left + RbAllTasks.Width + 48;
// Next settings work correctly only for Windows.