You've already forked lazarus-ccr
* Remove multilog dependency from demos
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@1119 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -1,7 +1,7 @@
|
|||||||
unit Main;
|
unit Main;
|
||||||
|
|
||||||
{$MODE Delphi}
|
{$MODE Delphi}
|
||||||
{.$define DEBUG}
|
{.$define DEBUG_VTV}
|
||||||
|
|
||||||
// Demonstration project for TVirtualStringTree to generally show how to get started.
|
// Demonstration project for TVirtualStringTree to generally show how to get started.
|
||||||
// Written by Mike Lischke.
|
// Written by Mike Lischke.
|
||||||
@ -9,7 +9,7 @@ unit Main;
|
|||||||
interface
|
interface
|
||||||
|
|
||||||
uses
|
uses
|
||||||
{$ifdef DEBUG}
|
{$ifdef DEBUG_VTV}
|
||||||
vtlogger, ipcchannel,
|
vtlogger, ipcchannel,
|
||||||
{$endif}
|
{$endif}
|
||||||
LCLIntf, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
|
LCLIntf, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
|
||||||
@ -58,7 +58,7 @@ type
|
|||||||
procedure TMainForm.FormCreate(Sender: TObject);
|
procedure TMainForm.FormCreate(Sender: TObject);
|
||||||
|
|
||||||
begin
|
begin
|
||||||
{$ifdef DEBUG}
|
{$ifdef DEBUG_VTV}
|
||||||
Logger.ActiveClasses:=[];//[lcScroll,lcPaint];
|
Logger.ActiveClasses:=[];//[lcScroll,lcPaint];
|
||||||
Logger.Channels.Add(TIPCChannel.Create);
|
Logger.Channels.Add(TIPCChannel.Create);
|
||||||
Logger.Clear;
|
Logger.Clear;
|
||||||
|
@ -18,7 +18,7 @@ interface
|
|||||||
uses
|
uses
|
||||||
LCLIntf, SysUtils,Classes,Graphics,Controls,Forms,Dialogs,
|
LCLIntf, SysUtils,Classes,Graphics,Controls,Forms,Dialogs,
|
||||||
MVCTypes,MVCPanel,StdCtrls,ExtCtrls,VirtualTrees,ComCtrls,
|
MVCTypes,MVCPanel,StdCtrls,ExtCtrls,VirtualTrees,ComCtrls,
|
||||||
Buttons, LResources, vtlogger,ipcchannel;
|
Buttons, LResources;
|
||||||
|
|
||||||
type
|
type
|
||||||
TfmMVCDemo=class(TForm)
|
TfmMVCDemo=class(TForm)
|
||||||
@ -90,9 +90,6 @@ end;
|
|||||||
|
|
||||||
procedure TfmMVCDemo.FormCreate(Sender: TObject);
|
procedure TfmMVCDemo.FormCreate(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
Logger.Channels.Add(TIPCChannel.Create);
|
|
||||||
Logger.ActiveClasses:=[];//[lcEditLink,lcScroll];
|
|
||||||
Logger.Clear;
|
|
||||||
P:=TMVCPanel.Create(Self);
|
P:=TMVCPanel.Create(Self);
|
||||||
with P do
|
with P do
|
||||||
begin
|
begin
|
||||||
|
@ -58,7 +58,7 @@ interface
|
|||||||
|
|
||||||
uses
|
uses
|
||||||
LCLIntf, Types, SysUtils, Graphics, VirtualTrees, Classes, StdCtrls,
|
LCLIntf, Types, SysUtils, Graphics, VirtualTrees, Classes, StdCtrls,
|
||||||
Controls, Forms, ImgList, LCLType, DelphiCompat, vtlogger, LMessages;
|
Controls, Forms, ImgList, LCLType, DelphiCompat, LMessages;
|
||||||
|
|
||||||
type { TMVCNode is the encapsulation of a single Node in the structure.
|
type { TMVCNode is the encapsulation of a single Node in the structure.
|
||||||
This implementation is a bit bloated because in my project
|
This implementation is a bit bloated because in my project
|
||||||
@ -259,7 +259,6 @@ type { TMVCNode is the encapsulation of a single Node in the structure.
|
|||||||
TMVCEdit=class(TCustomEdit)
|
TMVCEdit=class(TCustomEdit)
|
||||||
private
|
private
|
||||||
FLink:TMVCEditLink;
|
FLink:TMVCEditLink;
|
||||||
procedure WMMove(var Message: TLMMove); message LM_MOVE;
|
|
||||||
procedure WMChar(var Message: TWMChar); message WM_CHAR;
|
procedure WMChar(var Message: TWMChar); message WM_CHAR;
|
||||||
procedure WMKeyDown(var Message: TWMKeyDown); message WM_KEYDOWN;
|
procedure WMKeyDown(var Message: TWMKeyDown); message WM_KEYDOWN;
|
||||||
//gtk1 has problems freeing a control inside keydow
|
//gtk1 has problems freeing a control inside keydow
|
||||||
@ -269,7 +268,6 @@ type { TMVCNode is the encapsulation of a single Node in the structure.
|
|||||||
procedure WMKillFocus(var Msg: TWMKillFocus); message WM_KILLFOCUS;
|
procedure WMKillFocus(var Msg: TWMKillFocus); message WM_KILLFOCUS;
|
||||||
protected
|
protected
|
||||||
procedure AutoAdjustSize;
|
procedure AutoAdjustSize;
|
||||||
procedure CreateParams(var Params:TCreateParams); override;
|
|
||||||
public
|
public
|
||||||
constructor Create(Link:TMVCEditLink); reintroduce;
|
constructor Create(Link:TMVCEditLink); reintroduce;
|
||||||
end;
|
end;
|
||||||
@ -826,7 +824,6 @@ begin
|
|||||||
with FEdit do
|
with FEdit do
|
||||||
begin
|
begin
|
||||||
Visible := False;
|
Visible := False;
|
||||||
Ctl3D := False;
|
|
||||||
BorderStyle := bsSingle;
|
BorderStyle := bsSingle;
|
||||||
AutoSize := False;
|
AutoSize := False;
|
||||||
end;
|
end;
|
||||||
@ -840,7 +837,6 @@ end;
|
|||||||
|
|
||||||
function TMVCEditLink.BeginEdit: Boolean;
|
function TMVCEditLink.BeginEdit: Boolean;
|
||||||
begin
|
begin
|
||||||
Logger.Send([lcEditLink],'FEdit.Handle',FEdit.Handle);
|
|
||||||
Result := True;
|
Result := True;
|
||||||
FEdit.Show;
|
FEdit.Show;
|
||||||
FEdit.SetFocus;
|
FEdit.SetFocus;
|
||||||
@ -929,32 +925,20 @@ begin
|
|||||||
FLink:=Link;
|
FLink:=Link;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TMVCEdit.WMMove(var Message: TLMMove);
|
|
||||||
begin
|
|
||||||
Logger.EnterMethod([lcEditLink],'TMVCEdit.WMMove');
|
|
||||||
Logger.Send([lcEditLink],'XPos: %d YPos: %d',[Message.XPos, Message.YPos]);
|
|
||||||
Logger.SendCallStack([lcEditLink],'Stack');
|
|
||||||
inherited WMMove(Message);
|
|
||||||
Logger.ExitMethod([lcEditLink],'TMVCEdit.WMMove');
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TMVCEdit.WMChar(var Message: TWMChar);
|
procedure TMVCEdit.WMChar(var Message: TWMChar);
|
||||||
// handle character keys
|
// handle character keys
|
||||||
begin
|
begin
|
||||||
Logger.EnterMethod([lcEditLink],'WMChar');
|
|
||||||
// avoid beep
|
// avoid beep
|
||||||
if Message.CharCode <> VK_ESCAPE then
|
if Message.CharCode <> VK_ESCAPE then
|
||||||
begin
|
begin
|
||||||
inherited WMChar(Message);
|
inherited WMChar(Message);
|
||||||
if Message.CharCode > $20 then AutoAdjustSize;
|
if Message.CharCode > $20 then AutoAdjustSize;
|
||||||
end;
|
end;
|
||||||
Logger.ExitMethod([lcEditLink],'WMChar');
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TMVCEdit.WMKeyDown(var Message: TWMKeyDown);
|
procedure TMVCEdit.WMKeyDown(var Message: TWMKeyDown);
|
||||||
// handles some control keys (either redirection to tree, edit window size or clipboard handling)
|
// handles some control keys (either redirection to tree, edit window size or clipboard handling)
|
||||||
begin
|
begin
|
||||||
Logger.EnterMethod([lcEditLink],'TMVCEdit.WMKeyDown');
|
|
||||||
case Message.CharCode of
|
case Message.CharCode of
|
||||||
// pretend these keycodes were send to the tree
|
// pretend these keycodes were send to the tree
|
||||||
VK_ESCAPE,
|
VK_ESCAPE,
|
||||||
@ -990,7 +974,6 @@ begin
|
|||||||
AutoAdjustSize;
|
AutoAdjustSize;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
Logger.ExitMethod([lcEditLink],'TMVCEdit.WMKeyDown');
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{$ifdef LCLGtk}
|
{$ifdef LCLGtk}
|
||||||
@ -1003,12 +986,10 @@ end;
|
|||||||
|
|
||||||
procedure TMVCEdit.WMKillFocus(var Msg: TWMKillFocus);
|
procedure TMVCEdit.WMKillFocus(var Msg: TWMKillFocus);
|
||||||
begin
|
begin
|
||||||
Logger.EnterMethod([lcEditLink],'TMVCEdit.WMKillFocus');
|
|
||||||
inherited WMKillFocus(Msg);
|
inherited WMKillFocus(Msg);
|
||||||
// FLink.FTree is set to nil if the link doesn't need to notify the tree (e.g. hiding the edit causes
|
// FLink.FTree is set to nil if the link doesn't need to notify the tree (e.g. hiding the edit causes
|
||||||
// a kill focus message)
|
// a kill focus message)
|
||||||
if Assigned(FLink.FTree) then FLink.FTree.DoCancelEdit;
|
if Assigned(FLink.FTree) then FLink.FTree.DoCancelEdit;
|
||||||
Logger.ExitMethod([lcEditLink],'TMVCEdit.WMKillFocus');
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TMVCEdit.AutoAdjustSize;
|
procedure TMVCEdit.AutoAdjustSize;
|
||||||
@ -1031,13 +1012,6 @@ begin
|
|||||||
ReleaseDC(Handle, DC);
|
ReleaseDC(Handle, DC);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TMVCEdit.CreateParams(var Params:TCreateParams);
|
|
||||||
begin
|
|
||||||
//todo: probably remove this since CTL3D does nothing in LCL
|
|
||||||
Ctl3D := False;
|
|
||||||
inherited;
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TMVCEditLink.ProcessMessage(var Message: TMessage);
|
procedure TMVCEditLink.ProcessMessage(var Message: TMessage);
|
||||||
begin
|
begin
|
||||||
// nothing to do
|
// nothing to do
|
||||||
|
@ -11,7 +11,7 @@ interface
|
|||||||
uses
|
uses
|
||||||
Windows, LCLIntf, ActiveX, SysUtils, Forms, Dialogs, Graphics,
|
Windows, LCLIntf, ActiveX, SysUtils, Forms, Dialogs, Graphics,
|
||||||
VirtualTrees, ActnList, ComCtrls, ExtCtrls, StdCtrls, Controls, Classes, Buttons,
|
VirtualTrees, ActnList, ComCtrls, ExtCtrls, StdCtrls, Controls, Classes, Buttons,
|
||||||
LResources, vtLogger,ipcchannel;
|
LResources;
|
||||||
|
|
||||||
type
|
type
|
||||||
|
|
||||||
@ -223,10 +223,6 @@ var
|
|||||||
}
|
}
|
||||||
|
|
||||||
begin
|
begin
|
||||||
Logger.Channels.Add(TIPCChannel.Create);
|
|
||||||
Logger.Clear;
|
|
||||||
Logger.ActiveClasses:=[lcDrag];//,lcPaintDetails,lcPaintBitmap];
|
|
||||||
//Logger.Enabled:=False;
|
|
||||||
Tree1.NodeDataSize := SizeOf(TNodeData);
|
Tree1.NodeDataSize := SizeOf(TNodeData);
|
||||||
Tree1.RootNodeCount := 30;
|
Tree1.RootNodeCount := 30;
|
||||||
Tree2.NodeDataSize := SizeOf(TNodeData);
|
Tree2.NodeDataSize := SizeOf(TNodeData);
|
||||||
|
Reference in New Issue
Block a user