Fixed bug when CreateWnd is called

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@62 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
blikblum
2007-02-19 18:27:29 +00:00
parent 74dbc81c4a
commit e40928982c
6 changed files with 27 additions and 147 deletions

View File

@ -29,7 +29,7 @@
{.$define EnableNativeTVM} {.$define EnableNativeTVM}
{.$define EnablePrint} {.$define EnablePrint}
{$define NeedWindows} {$define NeedWindows}
{$define EnableNCFunctions} {.$define EnableNCFunctions}
{.$define EnableAdvancedGraphics} {.$define EnableAdvancedGraphics}
{.$define EnableHeader} {.$define EnableHeader}
{.$define EnableTimer} {.$define EnableTimer}

View File

@ -17909,8 +17909,9 @@ begin
PrepareBitmaps(True, True); PrepareBitmaps(True, True);
// Register tree as OLE drop target. // Register tree as OLE drop target.
if not (csDesigning in ComponentState) and (toAcceptOLEDrop in FOptions.FMiscOptions) then // Somehow calling this code causes a SIGSEG
RegisterDragDrop(Handle, DragManager as IDropTarget); //if not (csDesigning in ComponentState) and (toAcceptOLEDrop in FOptions.FMiscOptions) then
// RegisterDragDrop(Handle, DragManager as IDropTarget);
UpdateScrollBars(True); UpdateScrollBars(True);
UpdateHeaderRect; UpdateHeaderRect;

View File

@ -17,7 +17,7 @@ interface
uses LCLIntf,Messages,SysUtils,Classes,Graphics,Controls,Forms,Dialogs, uses LCLIntf,Messages,SysUtils,Classes,Graphics,Controls,Forms,Dialogs,
MVCTypes,MVCPanel,StdCtrls,ExtCtrls,ImgList,VirtualTrees,ComCtrls, MVCTypes,MVCPanel,StdCtrls,ExtCtrls,ImgList,VirtualTrees,ComCtrls,
Buttons, LResources; Buttons, LResources, vtlogger,ipcchannel;
type TfmMVCDemo=class(TForm) type TfmMVCDemo=class(TForm)
pnlControls:TPanel; pnlControls:TPanel;
@ -87,6 +87,9 @@ end;
procedure TfmMVCDemo.FormCreate(Sender: TObject); procedure TfmMVCDemo.FormCreate(Sender: TObject);
begin begin
Logger.Channels.Add(TIPCChannel.Create);
Logger.ActiveClasses:=[lcEditLink];
Logger.Clear;
P:=TMVCPanel.Create(Self); P:=TMVCPanel.Create(Self);
with P do with P do
begin begin

View File

@ -57,7 +57,7 @@ unit MVCTypes;
interface interface
uses Windows, LCLIntf,Messages,SysUtils,Graphics,VirtualTrees,Classes,StdCtrls, uses Windows, LCLIntf,Messages,SysUtils,Graphics,VirtualTrees,Classes,StdCtrls,
Controls,Forms,ImgList,LCLType, delphicompat; Controls,Forms,ImgList,LCLType, delphicompat, vtlogger;
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
@ -832,6 +832,7 @@ 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;
@ -923,17 +924,20 @@ 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; inherited;
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,
@ -967,14 +971,17 @@ begin
AutoAdjustSize; AutoAdjustSize;
end; end;
end; end;
Logger.ExitMethod(lcEditLink,'TMVCEdit.WMKeyDown');
end; end;
procedure TMVCEdit.WMKillFocus(var Msg: TWMKillFocus); procedure TMVCEdit.WMKillFocus(var Msg: TWMKillFocus);
begin begin
Logger.EnterMethod(lcEditLink,'TMVCEdit.WMKillFocus');
inherited; inherited;
// 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;

View File

@ -4,17 +4,19 @@
<PathDelim Value="\"/> <PathDelim Value="\"/>
<Version Value="5"/> <Version Value="5"/>
<General> <General>
<Flags>
<AlwaysBuild Value="False"/>
</Flags>
<SessionStorage Value="InProjectDir"/>
<MainUnit Value="0"/> <MainUnit Value="0"/>
<IconPath Value="./"/> <IconPath Value="./"/>
<TargetFileExt Value=".exe"/> <TargetFileExt Value=".exe"/>
<ActiveEditorIndexAtStart Value="7"/>
</General> </General>
<VersionInfo> <VersionInfo>
<ProjectVersion Value=""/> <ProjectVersion Value=""/>
</VersionInfo> </VersionInfo>
<PublishOptions> <PublishOptions>
<Version Value="2"/> <Version Value="2"/>
<IgnoreBinaries Value="False"/>
<IncludeFileFilter Value="*.(pas|pp|inc|lfm|lpr|lrs|lpi|lpk|sh|xml)"/> <IncludeFileFilter Value="*.(pas|pp|inc|lfm|lpr|lrs|lpi|lpk|sh|xml)"/>
<ExcludeFileFilter Value="*.(bak|ppu|ppw|o|so);*~;backup"/> <ExcludeFileFilter Value="*.(bak|ppu|ppw|o|so);*~;backup"/>
</PublishOptions> </PublishOptions>
@ -35,148 +37,31 @@
<PackageName Value="LCL"/> <PackageName Value="LCL"/>
</Item3> </Item3>
</RequiredPackages> </RequiredPackages>
<Units Count="13"> <Units Count="4">
<Unit0> <Unit0>
<Filename Value="mvcdemo.lpr"/> <Filename Value="mvcdemo.lpr"/>
<IsPartOfProject Value="True"/> <IsPartOfProject Value="True"/>
<UnitName Value="mvcdemo"/> <UnitName Value="mvcdemo"/>
<CursorPos X="63" Y="18"/>
<TopLine Value="1"/>
<EditorIndex Value="7"/>
<UsageCount Value="20"/>
<Loaded Value="True"/>
</Unit0> </Unit0>
<Unit1> <Unit1>
<Filename Value="fmain.pas"/>
<ComponentName Value="Form1"/>
<ResourceFilename Value="fmain.lrs"/>
<UnitName Value="fmain"/>
<CursorPos X="9" Y="5"/>
<TopLine Value="1"/>
<UsageCount Value="20"/>
</Unit1>
<Unit2>
<Filename Value="MVCDemoMain.pas"/> <Filename Value="MVCDemoMain.pas"/>
<ComponentName Value="fmMVCDemo"/> <ComponentName Value="fmMVCDemo"/>
<HasResources Value="True"/> <HasResources Value="True"/>
<IsPartOfProject Value="True"/> <IsPartOfProject Value="True"/>
<ResourceFilename Value="MVCDemoMain.lrs"/> <ResourceFilename Value="MVCDemoMain.lrs"/>
<UnitName Value="MVCDemoMain"/> <UnitName Value="MVCDemoMain"/>
<CursorPos X="9" Y="16"/> </Unit1>
<TopLine Value="57"/> <Unit2>
<EditorIndex Value="0"/>
<UsageCount Value="20"/>
<Loaded Value="True"/>
</Unit2>
<Unit3>
<Filename Value="MVCPanel.pas"/> <Filename Value="MVCPanel.pas"/>
<IsPartOfProject Value="True"/> <IsPartOfProject Value="True"/>
<UnitName Value="MVCPanel"/> <UnitName Value="MVCPanel"/>
<CursorPos X="18" Y="79"/> </Unit2>
<TopLine Value="69"/> <Unit3>
<EditorIndex Value="2"/>
<UsageCount Value="20"/>
<Loaded Value="True"/>
</Unit3>
<Unit4>
<Filename Value="MVCTypes.pas"/> <Filename Value="MVCTypes.pas"/>
<IsPartOfProject Value="True"/> <IsPartOfProject Value="True"/>
<UnitName Value="MVCTypes"/> <UnitName Value="MVCTypes"/>
<CursorPos X="26" Y="1"/> </Unit3>
<TopLine Value="1"/>
<EditorIndex Value="3"/>
<UsageCount Value="20"/>
<Loaded Value="True"/>
</Unit4>
<Unit5>
<Filename Value="..\..\VirtualTrees.pas"/>
<UnitName Value="VirtualTrees"/>
<CursorPos X="5" Y="17913"/>
<TopLine Value="17896"/>
<EditorIndex Value="8"/>
<UsageCount Value="10"/>
<Loaded Value="True"/>
</Unit5>
<Unit6>
<Filename Value="..\..\..\luipack\trunk\miscutils\delphicompat.pas"/>
<UnitName Value="delphicompat"/>
<CursorPos X="31" Y="39"/>
<TopLine Value="28"/>
<EditorIndex Value="6"/>
<UsageCount Value="10"/>
<Loaded Value="True"/>
</Unit6>
<Unit7>
<Filename Value="..\..\..\lazarus\lcl\controls.pp"/>
<UnitName Value="Controls"/>
<CursorPos X="50" Y="1542"/>
<TopLine Value="1525"/>
<EditorIndex Value="4"/>
<UsageCount Value="10"/>
<Loaded Value="True"/>
</Unit7>
<Unit8>
<Filename Value="..\..\..\lazarus\lcl\lcltype.pp"/>
<UnitName Value="LCLType"/>
<CursorPos X="3" Y="2043"/>
<TopLine Value="2026"/>
<EditorIndex Value="5"/>
<UsageCount Value="10"/>
<Loaded Value="True"/>
</Unit8>
<Unit9>
<Filename Value="..\..\VTConfig.inc"/>
<CursorPos X="3" Y="32"/>
<TopLine Value="1"/>
<EditorIndex Value="11"/>
<UsageCount Value="10"/>
<Loaded Value="True"/>
</Unit9>
<Unit10>
<Filename Value="..\..\..\lazarus\lcl\interfaces\win32\win32callback.inc"/>
<CursorPos X="34" Y="940"/>
<TopLine Value="922"/>
<EditorIndex Value="10"/>
<UsageCount Value="10"/>
<Loaded Value="True"/>
</Unit10>
<Unit11>
<Filename Value="..\..\port.log"/>
<CursorPos X="51" Y="172"/>
<TopLine Value="153"/>
<EditorIndex Value="9"/>
<UsageCount Value="10"/>
<Loaded Value="True"/>
<SyntaxHighlighter Value="None"/>
</Unit11>
<Unit12>
<Filename Value="..\..\..\luipack\trunk\multilog\multiloglcl.pas"/>
<UnitName Value="multiloglcl"/>
<CursorPos X="4" Y="91"/>
<TopLine Value="67"/>
<EditorIndex Value="1"/>
<UsageCount Value="10"/>
<Loaded Value="True"/>
</Unit12>
</Units> </Units>
<JumpHistory Count="4" HistoryIndex="3">
<Position1>
<Filename Value="..\..\..\luipack\trunk\multilog\multiloglcl.pas"/>
<Caret Line="1" Column="1" TopLine="1"/>
</Position1>
<Position2>
<Filename Value="..\..\..\luipack\trunk\multilog\multiloglcl.pas"/>
<Caret Line="47" Column="15" TopLine="30"/>
</Position2>
<Position3>
<Filename Value="..\..\VirtualTrees.pas"/>
<Caret Line="17911" Column="39" TopLine="17880"/>
</Position3>
<Position4>
<Filename Value="..\..\VTConfig.inc"/>
<Caret Line="32" Column="3" TopLine="1"/>
</Position4>
</JumpHistory>
</ProjectOptions> </ProjectOptions>
<CompilerOptions> <CompilerOptions>
<Version Value="5"/> <Version Value="5"/>
@ -184,25 +69,8 @@
<CodeGeneration> <CodeGeneration>
<Generate Value="Faster"/> <Generate Value="Faster"/>
</CodeGeneration> </CodeGeneration>
<Linking>
<Options>
<Win32>
<GraphicApplication Value="True"/>
</Win32>
</Options>
</Linking>
<Other> <Other>
<CompilerPath Value="$(CompPath)"/> <CompilerPath Value="$(CompPath)"/>
</Other> </Other>
</CompilerOptions> </CompilerOptions>
<Debugging>
<Exceptions Count="2">
<Item1>
<Name Value="ECodetoolError"/>
</Item1>
<Item2>
<Name Value="EFOpenError"/>
</Item2>
</Exceptions>
</Debugging>
</CONFIG> </CONFIG>

View File

@ -27,6 +27,7 @@ const
lcScroll = 12; lcScroll = 12;
lcPaintDetails = 13; lcPaintDetails = 13;
lcCheck = 14; lcCheck = 14;
lcEditLink = 15;
var var
Logger: TLCLLogger; Logger: TLCLLogger;