diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/VERSION_FILE.inc | 2 | ||||
-rw-r--r-- | src/corelib/fpg_base.pas | 35 | ||||
-rw-r--r-- | src/corelib/x11/fpg_x11.pas | 13 | ||||
-rw-r--r-- | src/gui/fpg_scrollbar.pas | 10 |
4 files changed, 43 insertions, 17 deletions
diff --git a/src/VERSION_FILE.inc b/src/VERSION_FILE.inc index 212d4aea..b47293e2 100644 --- a/src/VERSION_FILE.inc +++ b/src/VERSION_FILE.inc @@ -1 +1 @@ -FPGUI_VERSION = '1.0'; +FPGUI_VERSION = '1.1'; diff --git a/src/corelib/fpg_base.pas b/src/corelib/fpg_base.pas index f3e8f6db..70f3b306 100644 --- a/src/corelib/fpg_base.pas +++ b/src/corelib/fpg_base.pas @@ -213,6 +213,13 @@ type PfpgMessageRec = ^TfpgMessageRec; + TfpgMoveEventRec = record + Sender: TObject; + x: TfpgCoord; + y: TfpgCoord; + end; + + TfpgLineStyle = (lsSolid, lsDash, lsDot, lsDashDot, lsDashDotDot); @@ -602,6 +609,7 @@ type TFileEntryType = (etFile, etDir); TFileListSortOrder = (soNone, soFileName, soCSFileName, soFileExt, soSize, soTime); TFileModeString = string[9]; + TfpgSearchMode = (smAny, smFiles, smDirs); // A simple data object @@ -641,6 +649,7 @@ type FEntries: TList; FDirectoryName: TfpgString; FFileMask: TfpgString; + FSearchMode: TfpgSearchMode; FShowHidden: boolean; FCurrentSpecialDir: integer; procedure AddEntry(sr: TSearchRec); @@ -663,6 +672,7 @@ type property Entry[i: integer]: TFileEntry read GetEntry; property FileMask: TfpgString read FFileMask write FFileMask; property HasFileMode: boolean read FHasFileMode; + property SearchMode: TfpgSearchMode read FSearchMode write FSearchMode; property ShowHidden: boolean read FShowHidden write FShowHidden; property SpecialDirs: TStringList read FSpecialDirs; end; @@ -2549,7 +2559,11 @@ var p: TProcess; begin Result := False; - if not fpgFileExists(GetHelpViewer) then + if fpgExtractFilePath(GetHelpViewer) = '' then + begin + // do nothing - we are hoping docview is in the system PATH + end + else if not fpgFileExists(GetHelpViewer) then raise EfpGUIUserFeedbackException.Create(rsfailedtofindhelpviewer); p := TProcess.Create(nil); try @@ -2577,7 +2591,11 @@ var p: TProcess; begin Result := False; - if not fpgFileExists(GetHelpViewer) then + if fpgExtractFilePath(GetHelpViewer) = '' then + begin + // do nothing - we are hoping docview is in the system PATH + end + else if not fpgFileExists(GetHelpViewer) then raise EfpGUIUserFeedbackException.Create(rsfailedtofindhelpviewer); p := TProcess.Create(nil); try @@ -2790,6 +2808,7 @@ begin FFileMask := '*'; FDirectoryName := ''; FSpecialDirs := TStringList.Create; + FSearchMode := smAny; end; destructor TfpgFileListBase.Destroy; @@ -2836,11 +2855,13 @@ begin // Reported to FPC as bug 9440 in Mantis. if fpgFindFirst(FDirectoryName + AllFilesMask, faAnyFile or $00000080, SearchRec) = 0 then begin - AddEntry(SearchRec); - while fpgFindNext(SearchRec) = 0 do - begin - AddEntry(SearchRec); - end; + repeat + if (FSearchMode=smAny) or + ((FSearchMode=smFiles) and (not HasAttrib(SearchRec.Attr, faDirectory))) or + ((FSearchMode=smDirs) and HasAttrib(SearchRec.Attr, faDirectory)) + then + AddEntry(SearchRec); + until fpgFindNext(SearchRec) <> 0; end; Result:=True; finally diff --git a/src/corelib/x11/fpg_x11.pas b/src/corelib/x11/fpg_x11.pas index 20974dfe..37b2b469 100644 --- a/src/corelib/x11/fpg_x11.pas +++ b/src/corelib/x11/fpg_x11.pas @@ -322,6 +322,7 @@ type function DoGetFontFaceList: TStringList; override; procedure DoWaitWindowMessage(atimeoutms: integer); override; function MessagesPending: boolean; override; + function GetHelpViewer: TfpgString; override; public constructor Create(const AParams: string); override; destructor Destroy; override; @@ -420,6 +421,7 @@ implementation uses baseunix, + unix, {$IFDEF LINUX} users, { For Linux user and group name support. FPC only supports this in Linux. } {$ENDIF} @@ -430,6 +432,7 @@ uses fpg_utils, fpg_form, // for modal event support fpg_cmdlineparams, + fpg_constants, cursorfont, xatom, // used for XA_WM_NAME keysym, @@ -1433,6 +1436,16 @@ begin fpgCheckTimers; end; +function TfpgX11Application.GetHelpViewer: TfpgString; +begin + Result := inherited GetHelpViewer; + if not fpgFileExists(Result) then + begin + if fpsystem('which ' + FPG_HELPVIEWER) = 0 then + Result := FPG_HELPVIEWER; + end; +end; + function GetParentWindow(wh: TfpgWinHandle; var pw, rw: TfpgWinHandle): boolean; var rootw: TfpgWinHandle; diff --git a/src/gui/fpg_scrollbar.pas b/src/gui/fpg_scrollbar.pas index dd0a4c7c..440372dd 100644 --- a/src/gui/fpg_scrollbar.pas +++ b/src/gui/fpg_scrollbar.pas @@ -363,8 +363,6 @@ var area: TfpgCoord; mm: TfpgCoord; begin -// Canvas.BeginDraw; - if SliderSize > 1 then SliderSize := 1; @@ -436,15 +434,9 @@ begin // Paint the slider button if Orientation = orVertical then - begin - Canvas.DrawButtonFace(0, Width + FSliderPos, Width, FSliderLength, [btfIsEmbedded]); -// Canvas.EndDraw(0, Width, Width, Height - Width - Width); - end + Canvas.DrawButtonFace(0, Width + FSliderPos, Width, FSliderLength, [btfIsEmbedded]) else - begin Canvas.DrawButtonFace(Height + FSliderPos, 0, FSliderLength, Height, [btfIsEmbedded]); -// Canvas.EndDraw(Height, 0, Width - Height - Height, Height); - end; end; procedure TfpgScrollBar.HandleLMouseDown(x, y: integer; shiftstate: TShiftState); |