diff --git a/lcl/extctrls.pp b/lcl/extctrls.pp index 4adc5a3839..9cea4ed52e 100644 --- a/lcl/extctrls.pp +++ b/lcl/extctrls.pp @@ -69,9 +69,6 @@ type function DialogChar(var Message: TLMKey): boolean; override; procedure DoHide; dynamic; procedure DoShow; dynamic; - {$IFDEF EnableSizePatch} - procedure DoSendBoundsToInterface; override; - {$ENDIF} public constructor Create(TheOwner: TComponent); override; procedure AdjustClientRect(var ARect: TRect); override; diff --git a/lcl/include/custompage.inc b/lcl/include/custompage.inc index 2d425ec626..b19e73b5a6 100644 --- a/lcl/include/custompage.inc +++ b/lcl/include/custompage.inc @@ -200,13 +200,6 @@ begin FOnShow(Self); end; -{$IFDEF EnableSizePatch} -procedure TCustomPage.DoSendBoundsToInterface; -begin - // a page is only sized by the interface -end; -{$ENDIF} - function TCustomPage.IsControlVisible: Boolean; begin if Parent is TCustomNotebook then diff --git a/lcl/interfaces/gtk/gtkcallback.inc b/lcl/interfaces/gtk/gtkcallback.inc index 8231502bdd..dfcff8e65d 100644 --- a/lcl/interfaces/gtk/gtkcallback.inc +++ b/lcl/interfaces/gtk/gtkcallback.inc @@ -1833,8 +1833,47 @@ var //SelectedFont: PGdkFont; function CheckOpenedFilename(const AFilename: string): boolean; + var + MenuWidget: PGtkWidget; + AFilterEntry: PFileSelFilterEntry; begin Result:=true; + {$IFNDEF GTK2} + // check if entered file are a real directory + if DirectoryExists(AFileName) then + begin + // if allowed then jump to that directory + if not (ofNoChangeDir in TOpenDialog(TheDialog).Options) then + begin + // change dir + gtk_file_selection_set_filename(PGtkFileSelection(FPointer), + PChar(AppendPathDelim(AFileName))); + // populate file list + MenuWidget := gtk_object_get_data(PGtkObject(PGtkFileSelection(FPointer)), 'LCLFilterMenu'); + if (MenuWidget <> nil) then begin + AFilterEntry := gtk_object_get_data(PGtkObject(gtk_menu_get_active( + PGtkMenu(MenuWidget))), 'LCLIsFilterMenuItem'); + if ((AFilterEntry<>nil) and (AFilterEntry^.Mask<>nil)) then + PopulateFileAndDirectoryLists(PGtkFileSelection(FPointer), AFilterEntry^.Mask); + end; + end; + // wait for correct input + result:=False; + Exit; + end; + // maybe user entered nonexistent dir + if ((AFileName<>'') and (IsPathDelimiter(AFileName, Length(AFileName)))) then + begin + // cant jump to nonexistent dir + if not (ofNoChangeDir in TOpenDialog(TheDialog).Options) then + MessageDlg(rsfdDirectoryMustExist, Format(rsfdDirectoryNotExist,[AFileName]), + mtError, [mbCancel], 0); // GTK2 shows "The folder contents could not be displayed" + // wait for correct input + result:=False; + Exit; + end; + {$ENDIF} + // maybe file already exists if (ofOverwritePrompt in TOpenDialog(theDialog).Options) and FileExists(AFilename) then begin diff --git a/lcl/interfaces/gtk/gtkwsextctrls.pp b/lcl/interfaces/gtk/gtkwsextctrls.pp index 7d51d1f44e..cfb08ab7c5 100644 --- a/lcl/interfaces/gtk/gtkwsextctrls.pp +++ b/lcl/interfaces/gtk/gtkwsextctrls.pp @@ -45,6 +45,7 @@ type protected public class procedure UpdateProperties(const ACustomPage: TCustomPage); override; + class procedure SetBounds(const AWinControl: TWinControl; const ALeft, ATop, AWidth, AHeight: Integer); override; end; { TGtkWSCustomNotebook } @@ -226,6 +227,12 @@ begin UpdateNotebookPageTab(nil, ACustomPage); end; +class procedure TGtkWSCustomPage.SetBounds(const AWinControl: TWinControl; + const ALeft, ATop, AWidth, AHeight: Integer); +begin + // ignore resizes from the LCL +end; + { TGtkWSCustomNotebook } class function TGtkWSCustomNotebook.CreateHandle(const AWinControl: TWinControl; diff --git a/tools/install/cross_unix/HowToCreate_fpc_crosswin32_deb.txt b/tools/install/cross_unix/HowToCreate_fpc_crosswin32_deb.txt index 764a3d807c..134647989a 100644 --- a/tools/install/cross_unix/HowToCreate_fpc_crosswin32_deb.txt +++ b/tools/install/cross_unix/HowToCreate_fpc_crosswin32_deb.txt @@ -2,7 +2,9 @@ How to create the fpc_crosswin32 deb This deb was only tested under linux. -For configuration see below. +The base directory is $BuildRoot. Default value is ~/freepascal + To change it use for example: + []$ export BuildRoot=/home/user/freepascal First get the FPC sources and the binutils. @@ -27,10 +29,3 @@ Then build the fpc_crosswin32 deb and install it: Now you can cross compile from linux to win32. - -================================================================================ - -The following environment variables are handled: -The base directory BuildRoot. Default value is ~/freepascal - []$ export BuildRoot=/home/user/freepascal -