* Open and save dialogs can now coexist in apps (however, only one of each type of common dialog can be used per app :( )
  * Fixed make all
  * Fixed crash in Windows 98/ME

git-svn-id: trunk@649 -
This commit is contained in:
lazarus 2002-01-31 09:32:07 +00:00
parent abc995925d
commit 431e35aef5
5 changed files with 68 additions and 27 deletions

View File

@ -1270,4 +1270,5 @@ include fpcmake.loc
endif
cleartarget:
$(DEL) $(wildcard ../../units/interfaces.*)
all: cleartarget interfaces$(PPUEXT)
all: cleartarget
$(MAKE) -W interfaces.pp interfaces$(PPUEXT)

View File

@ -25,4 +25,5 @@ files=$(wildcard ../../units/win32/*$(OEXT)) $(wildcard ../../units/win32/*$(PPU
cleartarget:
$(DEL) $(wildcard ../../units/interfaces.*)
all: cleartarget interfaces$(PPUEXT)
all: cleartarget
$(MAKE) -W interfaces.pp interfaces$(PPUEXT)

View File

@ -1,7 +1,7 @@
{$IFOPT C-}
// Uncomment for local trace
// {$C+}
// {$DEFINE ASSERT_IS_ON}
{$C+}
{$DEFINE ASSERT_IS_ON}
{$ENDIF}
@ -1482,10 +1482,14 @@ end;}
{$C-}
{$ENDIF}
{ $I Win32DragCallback.inc}
{
$Log$
Revision 1.7 2002/01/31 09:32:07 lazarus
Keith:
* Open and save dialogs can now coexist in apps (however, only one of each type of common dialog can be used per app :( )
* Fixed make all
* Fixed crash in Windows 98/ME
Revision 1.6 2002/01/25 19:42:56 lazarus
Keith: Improved events and common dialogs on Win32

View File

@ -130,7 +130,7 @@ Type
Procedure PaintPixmap(Surface: TObject; PixmapData: Pointer);
Procedure NormalizeIconName(Var IconName: String);
Procedure NormalizeIconName(Var IconName: PChar);
Procedure CreateCommonDialog(Sender: TObject);
Procedure CreateCommonDialog(Sender: TCommonDialog);
Public
{ Constructor of the class }
Constructor Create;
@ -332,6 +332,12 @@ End.
{ =============================================================================
$Log$
Revision 1.8 2002/01/31 09:32:07 lazarus
Keith:
* Open and save dialogs can now coexist in apps (however, only one of each type of common dialog can be used per app :( )
* Fixed make all
* Fixed crash in Windows 98/ME
Revision 1.7 2002/01/25 19:42:56 lazarus
Keith: Improved events and common dialogs on Win32

View File

@ -527,7 +527,8 @@ activate_time : the time at which the activation event occurred.
End;
LM_SETFOCUS:
Begin
SetFocus(Handle);
If Handle <> 0 Then
SetFocus(Handle);
End;
LM_SETSIZE:
Begin
@ -1240,7 +1241,7 @@ End;
Creates a common dialog
------------------------------------------------------------------------------}
Procedure TWin32Object.CreateCommonDialog(Sender: TObject);
Procedure TWin32Object.CreateCommonDialog(Sender: TCommonDialog);
Const
{ 16 basic RGB colors; names listed in comments for debugging }
CustomColors: Array[1..16] Of DWord = (
@ -1311,9 +1312,10 @@ Var
End;
Begin
Assert(False, 'Trace:TWin32Object.CreateCommonDialog - Start');
Assert(False, Format('Trace:TWin32Object.CreateCommonDialog - class name --> ', [Sender.ClassName]));
Assert(False, Format('Trace:TWin32Object.CreateCommonDialog - class name --> ', [TCommonDialog(Sender).ClassName]));
If Sender Is TColorDialog Then
Begin
CC := LPChooseColor(@Sender)^;
ZeroMemory(@CC, SizeOf(TChooseColor));
With CC Do
Begin
@ -1328,27 +1330,47 @@ Begin
End
Else If Sender Is TFileDialog Then
Begin
FN := (Sender As TFileDialog).FileName;
ZeroMemory(@OpenFile, SizeOf(OpenFileName));
With OpenFile Do
Begin
LStructSize := SizeOf(OpenFileName);
HWndOwner := ((Sender As TComponent).Owner As TWinControl).Handle;
LPStrFilter := PChar((Sender As TFileDialog).Filter);
If FN <> '' Then
LPStrFile := PChar(FN);
LPStrFileTitle := PChar((Sender As TCommonDialog).Title);
LPStrInitialDir := PChar((Sender As TFileDialog).InitialDir);
If Sender Is TOpenDialog Then
Flags := GetFlagsFromOptions((Sender As TOpenDialog).Options);
End;
If Sender Is TOpenDialog Then
Begin
OpenFile := LPOpenFileName(@Sender)^;
//FN := (Sender As TFileDialog).FileName;
ZeroMemory(@OpenFile, SizeOf(OpenFileName));
With OpenFile Do
Begin
LStructSize := SizeOf(OpenFileName);
HWndOwner := ((Sender As TComponent).Owner As TWinControl).Handle;
//LPStrFilter := PChar((Sender As TFileDialog).Filter);
//If FN <> '' Then
//LPStrFile := PChar(FN);
//LPStrFileTitle := PChar((Sender As TCommonDialog).Title);
LPStrInitialDir := PChar((Sender As TFileDialog).InitialDir);
Flags := GetFlagsFromOptions((Sender As TOpenDialog).Options);
End;
Ret := GetOpenFileName(@OpenFile)
End
Else If Sender Is TSaveDialog Then
Ret := GetSaveFileName(@OpenFile)
Begin
OpenFile := LPOpenFileName(@Sender)^;
FN := (Sender As TFileDialog).FileName;
ZeroMemory(@OpenFile, SizeOf(OpenFileName));
With OpenFile Do
Begin
LStructSize := SizeOf(OpenFileName);
HWndOwner := ((Sender As TComponent).Owner As TWinControl).Handle;
//LPStrFilter := PChar((Sender As TFileDialog).Filter);
//If FN <> '' Then
//LPStrFile := PChar(FN);
//LPStrFileTitle := PChar((Sender As TCommonDialog).Title);
LPStrInitialDir := PChar((Sender As TFileDialog).InitialDir);
//If Sender Is TOpenDialog Then
// Flags := GetFlagsFromOptions((Sender As TOpenDialog).Options);
End;
Ret := GetSaveFileName(@OpenFile);
End;
End
Else If Sender Is TFontDialog Then
Begin
CF := LPChooseFont(@Sender)^;
ZeroMemory(@CF, SizeOf(TChooseFont));
LF.LFFaceName := (Sender As TFontDialog).FontName;
With CF Do
@ -1366,6 +1388,7 @@ Begin
(Sender As TCommonDialog).UserChoice := mrOK
Else
(Sender As TCommonDialog).UserChoice := mrCancel;
Assert(False, 'Trace:TWin32Object.CreateCommonDialog - Exit');
End;
@ -1702,7 +1725,7 @@ Begin
End;
csColorDialog, csFileDialog, csFontDialog:
Begin
CreateCommonDialog(Sender);
CreateCommonDialog(TCommonDialog(Sender));
End;
csFixed:
Begin
@ -2962,7 +2985,7 @@ End;
{------------------------------------------------------------------------------
Method: TWin32Object.DrawText
Params: Child - Object on which tet will be drawn
Params: Child - Object on which text will be drawn
Data - Information needed to draw the text
Returns: Nothing
@ -2997,6 +3020,12 @@ End;
{
$Log$
Revision 1.12 2002/01/31 09:32:07 lazarus
Keith:
* Open and save dialogs can now coexist in apps (however, only one of each type of common dialog can be used per app :( )
* Fixed make all
* Fixed crash in Windows 98/ME
Revision 1.11 2002/01/25 19:42:56 lazarus
Keith: Improved events and common dialogs on Win32