mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-25 21:19:23 +02:00
Improves lcl-fpgui
git-svn-id: trunk@15001 -
This commit is contained in:
parent
51800bb1a9
commit
971f1f253f
@ -112,7 +112,7 @@ uses
|
||||
// FpGuiWSDialogs,
|
||||
// FpGuiWSDirSel,
|
||||
// FpGuiWSEditBtn,
|
||||
// FpGuiWSExtCtrls,
|
||||
FpGuiWSExtCtrls,
|
||||
// FpGuiWSExtDlgs,
|
||||
// FpGuiWSFileCtrl,
|
||||
FpGuiWSForms,
|
||||
|
@ -27,14 +27,11 @@ unit FpGuiWSComCtrls;
|
||||
interface
|
||||
|
||||
uses
|
||||
////////////////////////////////////////////////////
|
||||
// I M P O R T A N T
|
||||
////////////////////////////////////////////////////
|
||||
// To get as little as posible circles,
|
||||
// uncomment only when needed for registration
|
||||
////////////////////////////////////////////////////
|
||||
// ComCtrls,
|
||||
////////////////////////////////////////////////////
|
||||
// Bindings
|
||||
fpguiwsprivate,
|
||||
// LCL
|
||||
ComCtrls,
|
||||
// Widgetset
|
||||
WSComCtrls, WSLCLClasses;
|
||||
|
||||
type
|
||||
|
@ -27,14 +27,12 @@ unit FpGuiWSExtCtrls;
|
||||
interface
|
||||
|
||||
uses
|
||||
////////////////////////////////////////////////////
|
||||
// I M P O R T A N T
|
||||
////////////////////////////////////////////////////
|
||||
// To get as little as posible circles,
|
||||
// uncomment only when needed for registration
|
||||
////////////////////////////////////////////////////
|
||||
// ExtCtrls,
|
||||
////////////////////////////////////////////////////
|
||||
// Bindings
|
||||
fpguiwsprivate,
|
||||
// LCL
|
||||
Classes,
|
||||
ExtCtrls, Controls, LCLType,
|
||||
// Widgetset
|
||||
WSExtCtrls, WSLCLClasses;
|
||||
|
||||
type
|
||||
@ -53,6 +51,9 @@ type
|
||||
private
|
||||
protected
|
||||
public
|
||||
class function CreateHandle(const AWinControl: TWinControl;
|
||||
const AParams: TCreateParams): HWND; override;
|
||||
class procedure DestroyHandle(const AWinControl: TWinControl); override;
|
||||
end;
|
||||
|
||||
{ TFpGuiWSPage }
|
||||
@ -159,14 +160,6 @@ type
|
||||
public
|
||||
end;
|
||||
|
||||
{ TFpGuiWSBoundLabel }
|
||||
|
||||
TFpGuiWSBoundLabel = class(TWSBoundLabel)
|
||||
private
|
||||
protected
|
||||
public
|
||||
end;
|
||||
|
||||
{ TFpGuiWSCustomLabeledEdit }
|
||||
|
||||
TFpGuiWSCustomLabeledEdit = class(TWSCustomLabeledEdit)
|
||||
@ -199,9 +192,65 @@ type
|
||||
public
|
||||
end;
|
||||
|
||||
{ TFpGuiWSCustomTrayIcon }
|
||||
|
||||
TFpGuiWSCustomTrayIcon = class(TWSCustomTrayIcon)
|
||||
public
|
||||
class function Hide(const ATrayIcon: TCustomTrayIcon): Boolean; override;
|
||||
class function Show(const ATrayIcon: TCustomTrayIcon): Boolean; override;
|
||||
class procedure InternalUpdate(const ATrayIcon: TCustomTrayIcon); override;
|
||||
class function ShowBalloonHint(const ATrayIcon: TCustomTrayIcon): Boolean; override;
|
||||
class function GetPosition(const ATrayIcon: TCustomTrayIcon): TPoint; override;
|
||||
end;
|
||||
|
||||
implementation
|
||||
|
||||
{ TFpGuiWSCustomNotebook }
|
||||
|
||||
class function TFpGuiWSCustomNotebook.CreateHandle(
|
||||
const AWinControl: TWinControl; const AParams: TCreateParams): HWND;
|
||||
begin
|
||||
Result := TLCLIntfHandle(TFPGUIPrivatePageControl.Create(AWinControl, AParams));
|
||||
end;
|
||||
|
||||
class procedure TFpGuiWSCustomNotebook.DestroyHandle(
|
||||
const AWinControl: TWinControl);
|
||||
begin
|
||||
TFPGUIPrivatePageControl(AWinControl.Handle).Free;
|
||||
|
||||
AWinControl.Handle := 0;
|
||||
end;
|
||||
|
||||
{ TFpGuiWSCustomTrayIcon }
|
||||
|
||||
class function TFpGuiWSCustomTrayIcon.Hide(const ATrayIcon: TCustomTrayIcon): Boolean;
|
||||
begin
|
||||
Result:=inherited Hide(ATrayIcon);
|
||||
end;
|
||||
|
||||
class function TFpGuiWSCustomTrayIcon.Show(const ATrayIcon: TCustomTrayIcon): Boolean;
|
||||
begin
|
||||
Result:=inherited Show(ATrayIcon);
|
||||
end;
|
||||
|
||||
class procedure TFpGuiWSCustomTrayIcon.InternalUpdate(
|
||||
const ATrayIcon: TCustomTrayIcon);
|
||||
begin
|
||||
inherited InternalUpdate(ATrayIcon);
|
||||
end;
|
||||
|
||||
class function TFpGuiWSCustomTrayIcon.ShowBalloonHint(
|
||||
const ATrayIcon: TCustomTrayIcon): Boolean;
|
||||
begin
|
||||
Result:=inherited ShowBalloonHint(ATrayIcon);
|
||||
end;
|
||||
|
||||
class function TFpGuiWSCustomTrayIcon.GetPosition(
|
||||
const ATrayIcon: TCustomTrayIcon): TPoint;
|
||||
begin
|
||||
Result:=inherited GetPosition(ATrayIcon);
|
||||
end;
|
||||
|
||||
initialization
|
||||
|
||||
////////////////////////////////////////////////////
|
||||
@ -211,7 +260,7 @@ initialization
|
||||
// which actually implement something
|
||||
////////////////////////////////////////////////////
|
||||
// RegisterWSComponent(TCustomPage, TFpGuiWSCustomPage);
|
||||
// RegisterWSComponent(TCustomNotebook, TFpGuiWSCustomNotebook);
|
||||
RegisterWSComponent(TCustomNotebook, TFpGuiWSCustomNotebook);
|
||||
// RegisterWSComponent(TPage, TFpGuiWSPage);
|
||||
// RegisterWSComponent(TNotebook, TFpGuiWSNotebook);
|
||||
// RegisterWSComponent(TShape, TFpGuiWSShape);
|
||||
|
@ -39,7 +39,7 @@ uses
|
||||
WSControls, WSLCLClasses, WSProc,
|
||||
// interface
|
||||
gfx_widget, gui_form, gui_button, gui_combobox, gui_dialogs,
|
||||
gui_edit, gui_checkbox, gui_radiobutton;
|
||||
gui_edit, gui_checkbox, gui_radiobutton, gui_tab;
|
||||
|
||||
|
||||
type
|
||||
@ -240,11 +240,15 @@ type
|
||||
function GetText: String;
|
||||
end;
|
||||
|
||||
{TFPGUIPrivateNotebook = class(TPrivateNotebook)
|
||||
{ TFPGUIPrivatePageControl }
|
||||
|
||||
TFPGUIPrivatePageControl = class(TFPGUIPrivateWidget)
|
||||
private
|
||||
protected
|
||||
public
|
||||
end;}
|
||||
{ Virtual methods }
|
||||
procedure CreateWidget(const AParams: TCreateParams); override;
|
||||
end;
|
||||
|
||||
|
||||
implementation
|
||||
@ -720,5 +724,17 @@ begin
|
||||
Result := RadioButton.Text;
|
||||
end;
|
||||
|
||||
{ TFPGUIPrivateNotebook }
|
||||
|
||||
procedure TFPGUIPrivatePageControl.CreateWidget(const AParams: TCreateParams);
|
||||
var
|
||||
ParentContainer: TFPGUIPrivateContainer;
|
||||
begin
|
||||
ParentContainer := TFPGUIPrivateContainer(LCLObject.Parent.Handle);
|
||||
|
||||
Widget := TfpgPageControl.Create(ParentContainer.Widget);
|
||||
Widget.SetPosition(LCLObject.Left, LCLObject.Top, LCLObject.Width, LCLObject.Height);
|
||||
end;
|
||||
|
||||
end.
|
||||
|
||||
|
@ -178,9 +178,11 @@ type
|
||||
private
|
||||
protected
|
||||
public
|
||||
class function CreateHandle(const AWinControl: TWinControl; const AParams: TCreateParams): TLCLIntfHandle; override;
|
||||
class procedure DestroyHandle(const AWinControl: TWinControl); override;
|
||||
|
||||
class function GetText(const AWinControl: TWinControl; var AText: String): Boolean; override;
|
||||
class procedure SetText(const AWinControl: TWinControl; const AText: String); override;
|
||||
class function CreateHandle(const AWinControl: TWinControl; const AParams: TCreateParams): TLCLIntfHandle; override;
|
||||
end;
|
||||
|
||||
{ TFpGuiWSCustomCheckBox }
|
||||
@ -189,18 +191,18 @@ type
|
||||
private
|
||||
protected
|
||||
public
|
||||
class function CreateHandle(const AWinControl: TWinControl;
|
||||
const AParams: TCreateParams): TLCLIntfHandle; override;
|
||||
class procedure DestroyHandle(const AWinControl: TWinControl); override;
|
||||
|
||||
class function RetrieveState(const ACustomCheckBox: TCustomCheckBox): TCheckBoxState; override;
|
||||
class procedure SetShortCut(const ACustomCheckBox: TCustomCheckBox;
|
||||
const OldShortCut, NewShortCut: TShortCut); override;
|
||||
class procedure SetState(const ACustomCheckBox: TCustomCheckBox; const NewState: TCheckBoxState); override;
|
||||
public
|
||||
|
||||
class function GetText(const AWinControl: TWinControl; var AText: String): Boolean; override;
|
||||
|
||||
class procedure SetText(const AWinControl: TWinControl; const AText: String); override;
|
||||
|
||||
class function CreateHandle(const AWinControl: TWinControl;
|
||||
const AParams: TCreateParams): TLCLIntfHandle; override;
|
||||
class procedure DestroyHandle(const AWinControl: TWinControl); override;
|
||||
end;
|
||||
|
||||
{ TFpGuiWSCheckBox }
|
||||
@ -225,18 +227,17 @@ type
|
||||
private
|
||||
protected
|
||||
public
|
||||
class function CreateHandle(const AWinControl: TWinControl;
|
||||
const AParams: TCreateParams): TLCLIntfHandle; override;
|
||||
class procedure DestroyHandle(const AWinControl: TWinControl); override;
|
||||
|
||||
class function RetrieveState(const ACustomCheckBox: TCustomCheckBox): TCheckBoxState; override;
|
||||
class procedure SetShortCut(const ACustomCheckBox: TCustomCheckBox;
|
||||
const OldShortCut, NewShortCut: TShortCut); override;
|
||||
class procedure SetState(const ACustomCheckBox: TCustomCheckBox; const NewState: TCheckBoxState); override;
|
||||
public
|
||||
|
||||
class function GetText(const AWinControl: TWinControl; var AText: String): Boolean; override;
|
||||
|
||||
class procedure SetText(const AWinControl: TWinControl; const AText: String); override;
|
||||
|
||||
class function CreateHandle(const AWinControl: TWinControl;
|
||||
const AParams: TCreateParams): TLCLIntfHandle; override;
|
||||
class procedure DestroyHandle(const AWinControl: TWinControl); override;
|
||||
end;
|
||||
|
||||
{ TFpGuiWSCustomStaticText }
|
||||
@ -288,9 +289,9 @@ end;
|
||||
------------------------------------------------------------------------------}
|
||||
class procedure TFpGuiWSCustomComboBox.DestroyHandle(const AWinControl: TWinControl);
|
||||
begin
|
||||
// TFPGUIPrivateComboBox(AWinControl.Handle).Free;
|
||||
TFPGUIPrivateComboBox(AWinControl.Handle).Free;
|
||||
|
||||
// AWinControl.Handle := 0;
|
||||
AWinControl.Handle := 0;
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
@ -358,7 +359,9 @@ end;
|
||||
------------------------------------------------------------------------------}
|
||||
class procedure TFpGuiWSCustomEdit.DestroyHandle(const AWinControl: TWinControl);
|
||||
begin
|
||||
TFPGUIPrivateEdit(AWinControl.Handle).Free;
|
||||
|
||||
AWinControl.Handle := 0;
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
@ -431,6 +434,13 @@ begin
|
||||
Result := TLCLIntfHandle(TFPGUIPrivateButton.Create(AWinControl, AParams));
|
||||
end;
|
||||
|
||||
class procedure TFpGuiWSButton.DestroyHandle(const AWinControl: TWinControl);
|
||||
begin
|
||||
TFPGUIPrivateButton(AWinControl.Handle).Free;
|
||||
|
||||
AWinControl.Handle := 0;
|
||||
end;
|
||||
|
||||
{ TFpGuiWSCustomCheckBox }
|
||||
|
||||
class function TFpGuiWSCustomCheckBox.RetrieveState(
|
||||
@ -496,7 +506,9 @@ end;
|
||||
class procedure TFpGuiWSCustomCheckBox.DestroyHandle(
|
||||
const AWinControl: TWinControl);
|
||||
begin
|
||||
TFPGUIPrivateCheckBox(AWinControl.Handle).Free;
|
||||
|
||||
AWinControl.Handle := 0;
|
||||
end;
|
||||
|
||||
{ TFpGuiWSRadioButton }
|
||||
@ -562,7 +574,9 @@ end;
|
||||
|
||||
class procedure TFpGuiWSRadioButton.DestroyHandle(const AWinControl: TWinControl);
|
||||
begin
|
||||
TFPGUIPrivateRadioButton(AWinControl.Handle).Free;
|
||||
|
||||
AWinControl.Handle := 0;
|
||||
end;
|
||||
|
||||
initialization
|
||||
|
Loading…
Reference in New Issue
Block a user