From 0b8e9b01d65f2e66b44150b15e084b2932bc3948 Mon Sep 17 00:00:00 2001 From: lazarus Date: Mon, 26 Mar 2001 14:58:32 +0000 Subject: [PATCH] MG: setwindowpos + bugfixes git-svn-id: trunk@240 - --- components/synedit/syneditautocomplete.pp | 12 ++++ lcl/controls.pp | 4 ++ lcl/forms.pp | 5 +- lcl/include/customform.inc | 23 +++++-- lcl/include/interfacebase.inc | 9 +++ lcl/include/winapi.inc | 9 +++ lcl/include/winapih.inc | 5 ++ lcl/include/wincontrol.inc | 38 +++++++++--- lcl/interfaces/gtk/gtkcallback.inc | 7 ++- lcl/interfaces/gtk/gtkobject.inc | 76 ++++++++++++++--------- lcl/interfaces/gtk/gtkwinapi.inc | 29 +++++++-- lcl/interfaces/gtk/gtkwinapih.inc | 5 ++ lcl/interfaces/gtk/gtkwinapiwindow.pp | 7 ++- lcl/lcllinux.pp | 10 +++ 14 files changed, 186 insertions(+), 53 deletions(-) diff --git a/components/synedit/syneditautocomplete.pp b/components/synedit/syneditautocomplete.pp index f698d86fea..263f62b1c7 100644 --- a/components/synedit/syneditautocomplete.pp +++ b/components/synedit/syneditautocomplete.pp @@ -88,6 +88,9 @@ type destructor Destroy; override; procedure AddCompletion(AToken, AValue, AComment: string); + {$IFDEF SYN_LAZARUS} + procedure DeleteCompletion(Index: integer); + {$ENDIF} function AddEditor(AEditor: TCustomSynEdit): boolean; procedure Execute(AEditor: TCustomSynEdit); virtual; procedure ExecuteCompletion(AToken: string; AEditor: TCustomSynEdit); @@ -175,6 +178,15 @@ begin fEOTokenChars := '()[]{}.'; end; +{$IFDEF SYN_LAZARUS} +procedure TCustomSynAutoComplete.DeleteCompletion(Index: integer); +begin + fCompletions.Delete(Index); + fCompletionComments.Delete(Index); + fCompletionValues.Delete(Index); +end; +{$ENDIF} + destructor TCustomSynAutoComplete.Destroy; begin fEditors.Free; diff --git a/lcl/controls.pp b/lcl/controls.pp index 8b7682f575..907c9f8ee3 100644 --- a/lcl/controls.pp +++ b/lcl/controls.pp @@ -664,6 +664,7 @@ TCMDialogKey = TLMKEY; procedure DetachSignals; virtual; procedure DestroyWnd; virtual; procedure UpdateShowing; virtual; + Procedure SetZOrder(Topmost: Boolean); override; procedure ShowControl(AControl: TControl); virtual; procedure WndProc(var Message : TLMessage); override; function DoMouseWheel(Shift: TShiftState; WheelDelta: Integer; MousePos: TPoint): Boolean; dynamic; @@ -1129,6 +1130,9 @@ end. { ============================================================================= $Log$ + Revision 1.17 2001/03/26 14:58:31 lazarus + MG: setwindowpos + bugfixes + Revision 1.16 2001/03/19 14:00:50 lazarus MG: fixed many unreleased DC and GDIObj bugs diff --git a/lcl/forms.pp b/lcl/forms.pp index 71266ff0e5..51b4c7b5aa 100644 --- a/lcl/forms.pp +++ b/lcl/forms.pp @@ -99,7 +99,8 @@ type Procedure SetDesigner(Value : TIDesigner); Procedure SetMenu(value : TMainMenu); Procedure SetFormStyle(Value : TFormStyle); - Procedure SetPosition(value : TPosition); + Procedure SetPosition(Value : TPosition); + Procedure SetVisible(Value: boolean); Procedure SetWindowState(Value : TWIndowState); Function GetCanvas: TControlCanvas; Function IsForm : Boolean; @@ -163,6 +164,7 @@ type property KeyPreview: Boolean read FKeyPreview write FKeyPreview; property Menu : TMainMenu read FMenu write SetMenu; property ModalResult : TModalResult read FModalResult write FModalResult; + property Visible write SetVisible default False; property WindowState: TWindowState read FWindowState write SetWIndowState default wsNormal; end; @@ -407,6 +409,7 @@ initialization Focusmessages := True; finalization + writeln('forms.pp - finalization section'); Application.Free; Application:= nil; Screen.Free; diff --git a/lcl/include/customform.inc b/lcl/include/customform.inc index 83c5b85134..585067923c 100644 --- a/lcl/include/customform.inc +++ b/lcl/include/customform.inc @@ -113,7 +113,6 @@ Begin if FDesigner <> nil then FDesigner.Notification(AComponent,Operation); End; - {------------------------------------------------------------------------------ Method: TCustomForm.SetFocus ------------------------------------------------------------------------------} @@ -122,7 +121,23 @@ Begin Assert(False, 'Trace:SETFOCUS'); //if not(Visible and Enabled) then Exit; Assert(False, 'Trace:SETFOCUS2'); -CNSendMessage(LM_SETFOCUS,Self,nil); + CNSendMessage(LM_SETFOCUS,Self,nil); +end; + +{------------------------------------------------------------------------------} +{ TCustomForm SetVisible } +{------------------------------------------------------------------------------} +Procedure TCustomForm.SetVisible(Value : boolean); +Begin + if fsCreating in FFormState then + if Value then + Include(FFormState, fsVisible) + else + Exclude(FFormState, fsVisible) + else + begin + inherited Visible := Value; + end; end; {------------------------------------------------------------------------------ @@ -859,8 +874,8 @@ end; { ============================================================================= $Log$ - Revision 1.16 2001/03/20 16:59:15 lazarus - MG: fixed many bugs (mem leaks, canvas) + Revision 1.17 2001/03/26 14:58:31 lazarus + MG: setwindowpos + bugfixes Revision 1.15 2001/03/19 14:41:56 lazarus MG: fixed many unreleased DC and GDIObj bugs diff --git a/lcl/include/interfacebase.inc b/lcl/include/interfacebase.inc index bb63382269..d19b7d0237 100644 --- a/lcl/include/interfacebase.inc +++ b/lcl/include/interfacebase.inc @@ -396,6 +396,12 @@ Begin Result := False; end; +function TInterfaceBase.SetWindowPos(hWnd: HWND; hWndInsertAfter: HWND; + X, Y, cx, cy: Integer; uFlags: UINT): Boolean; +begin + Result:=false; +end; + function TInterfaceBase.ShowCaret(hWnd: HWND): Boolean; begin Result := False; @@ -432,6 +438,9 @@ end; { ============================================================================= $Log$ + Revision 1.13 2001/03/26 14:58:31 lazarus + MG: setwindowpos + bugfixes + Revision 1.12 2001/03/12 12:17:01 lazarus MG: fixed random function results diff --git a/lcl/include/winapi.inc b/lcl/include/winapi.inc index 2b48fcd0a9..c0517fe922 100644 --- a/lcl/include/winapi.inc +++ b/lcl/include/winapi.inc @@ -396,6 +396,12 @@ begin Result := InterfaceObject.SetWindowOrgEx(dc,NewX,NewY,lpPoint); end; +function SetWindowPos(hWnd: HWND; hWndInsertAfter: HWND; + X, Y, cx, cy: Integer; uFlags: UINT): Boolean; +begin + Result:=false; +end; + function ShowCaret(hWnd: HWND): Boolean; begin Result := InterfaceObject.ShowCaret(hWnd) @@ -965,6 +971,9 @@ end; { ============================================================================= $Log$ + Revision 1.12 2001/03/26 14:58:31 lazarus + MG: setwindowpos + bugfixes + Revision 1.11 2001/02/16 19:13:30 lazarus Added some functions Shane diff --git a/lcl/include/winapih.inc b/lcl/include/winapih.inc index aed61bc388..480ee661ce 100644 --- a/lcl/include/winapih.inc +++ b/lcl/include/winapih.inc @@ -125,6 +125,8 @@ Function SetTextCharacterExtra(_hdc : hdc; nCharExtra : Integer):Integer; {$IFDE function SetTextColor(DC: HDC; Color: TColorRef): TColorRef; {$IFDEF IF_BASE_MEMBER}virtual;{$ENDIF} function SetWindowLong(Handle: HWND; Idx: Integer; NewLong : Longint): Longint;{$IFDEF IF_BASE_MEMBER}virtual;{$ENDIF} function SetWindowOrgEx(dc : hdc; NewX, NewY : Integer; Var Point : TPoint): Boolean; {$IFDEF IF_BASE_MEMBER}virtual;{$ENDIF} +function SetWindowPos(hWnd: HWND; hWndInsertAfter: HWND; + X, Y, cx, cy: Integer; uFlags: UINT): Boolean; {$IFDEF IF_BASE_MEMBER}virtual;{$ENDIF} function ShowCaret(hWnd: HWND): Boolean; {$IFDEF IF_BASE_MEMBER}virtual;{$ENDIF} function ShowScrollBar(Handle: HWND; wBar: Integer; bShow: Boolean): Boolean; {$IFDEF IF_BASE_MEMBER}virtual;{$ENDIF} function StretchBlt(DestDC: HDC; X, Y, Width, Height: Integer; SrcDC: HDC; XSrc, YSrc, SrcWidth, SrcHeight: Integer; Rop: Cardinal): Boolean; {$IFDEF IF_BASE_MEMBER}virtual;{$ENDIF} @@ -221,6 +223,9 @@ function UnionRect(var lprcDst: TRect; const lprcSrc1, lprcSrc2: TRect): Boolean { ============================================================================= $Log$ + Revision 1.9 2001/03/26 14:58:31 lazarus + MG: setwindowpos + bugfixes + Revision 1.8 2001/02/16 19:13:31 lazarus Added some functions Shane diff --git a/lcl/include/wincontrol.inc b/lcl/include/wincontrol.inc index 9818de7df0..1d8f30c182 100644 --- a/lcl/include/wincontrol.inc +++ b/lcl/include/wincontrol.inc @@ -116,11 +116,13 @@ var end; end; end; - if (Control.Left <> Left2) or (Control.Top <> Top2) or (Control.Width <> Width2) or (Control.Height <> Height2) then begin + if (Control.Left <> Left2) or (Control.Top <> Top2) + or (Control.Width <> Width2) or (Control.Height <> Height2) then begin Control.SetBounds(Left2, Top2, Width2, Height2); end; - {Sometimes the control doesn't resize. This will verifiy that it is the size it is assigned to be} + {Sometimes the control doesn't resize. This will verifiy that it is the + size it is assigned to be} if (Control.Width <> Width2) or (Control.Height <> Height2) then with Rect do case AAlign of @@ -355,8 +357,26 @@ end; {------------------------------------------------------------------------------} Procedure TWinControl.SetBorderWidth(value : TBorderWidth); Begin -//TODO: SETBORDERWIDTH - Not sure if anything more is needed here -FBorderWidth := Value; + //TODO: SETBORDERWIDTH - Not sure if anything more is needed here + FBorderWidth := Value; +end; + +Procedure TWinControl.SetZOrder(Topmost: Boolean); +const + WindowPos: array[Boolean] of Word = (HWND_BOTTOM, HWND_TOP); +var i: integer; +begin + if FParent <> nil then + begin + if TopMost then i := FParent.FWinControls.Count - 1 + else i := 0; + if FParent.FControls <> nil then inc(i, FParent.FControls.Count); + SetZOrderPosition(i); + end + else if FHandle <> 0 then begin + InterfaceObject.SetWindowPos(FHandle, WindowPos[TopMost], 0, 0, 0, 0, + SWP_NOMOVE + SWP_NOSIZE); + end; end; {------------------------------------------------------------------------------} @@ -1802,7 +1822,8 @@ procedure TWinControl.SetBounds(aLeft, aTop, aWidth, aHeight : integer); var R : TRect; begin - if (ALeft = Left) and (ATop = Top) and (AWidth = Width) and (AHeight = Height) then Exit; + if (ALeft = Left) and (ATop = Top) and (AWidth = Width) and (AHeight = Height) + then Exit; FLeft := aLeft; FTop := aTop; FWidth := aWidth; @@ -1811,6 +1832,7 @@ begin if HandleAllocated then begin R:= Rect(ALeft, ATop, AWidth, AHeight); +//writeln('[TWinControl.SetBounds] ',name,':',Classname,' ',Height); CNSendMessage(LM_SetSize, Self, @R); end else inherited SetBounds(aLeft, aTop, aWidth, aHeight); @@ -1917,7 +1939,7 @@ end; procedure TWinControl.CMShowingChanged(var Message: TLMessage); begin { if (TWinControl(Self).HandleAllocated) or (Self is TCustomForm) then} - CNSendMessage(LM_ShowHide, Self, nil); + CNSendMessage(LM_ShowHide, Self, nil); // SetWindowPos(FHandle, 0, 0, 0, 0, 0, ShowFlags[FShowing]); end; @@ -1941,8 +1963,8 @@ end; { ============================================================================= $Log$ - Revision 1.25 2001/03/20 16:59:15 lazarus - MG: fixed many bugs (mem leaks, canvas) + Revision 1.26 2001/03/26 14:58:31 lazarus + MG: setwindowpos + bugfixes Revision 1.24 2001/03/19 14:38:39 lazarus MG: fixed many unreleased DC and GDIObj bugs diff --git a/lcl/interfaces/gtk/gtkcallback.inc b/lcl/interfaces/gtk/gtkcallback.inc index 62d3f8c9ae..0656d4c525 100644 --- a/lcl/interfaces/gtk/gtkcallback.inc +++ b/lcl/interfaces/gtk/gtkcallback.inc @@ -588,7 +588,8 @@ begin // ,TControl(Data).Left,',',TControl(Data).Top,' ',Size^.X,',',Size^.Y); Dummy.X:=TControl(Data).Left; Dummy.Y:=TControl(Data).Top; - gdk_window_get_root_origin(widget^.window, @Dummy.X, @Dummy.Y); + if widget^.window<>nil then + gdk_window_get_root_origin(widget^.window, @Dummy.X, @Dummy.Y); Size^.X:=Dummy.X; Size^.Y:=Dummy.Y; end; @@ -1104,8 +1105,8 @@ end; { ============================================================================= $Log$ - Revision 1.27 2001/03/21 23:48:29 lazarus - MG: fixed window positions + Revision 1.28 2001/03/26 14:58:31 lazarus + MG: setwindowpos + bugfixes Revision 1.26 2001/03/19 14:44:22 lazarus MG: fixed many unreleased DC and GDIObj bugs diff --git a/lcl/interfaces/gtk/gtkobject.inc b/lcl/interfaces/gtk/gtkobject.inc index d863cefb80..6557f4b880 100644 --- a/lcl/interfaces/gtk/gtkobject.inc +++ b/lcl/interfaces/gtk/gtkobject.inc @@ -254,7 +254,8 @@ Begin //could we just call IntSendMessage?? //destroy old widget - gtk_widget_destroy(PgtkWidget(TWinControl(sender).HANDLE)); + if TWinControl(sender).HANDLE<>0 then + gtk_widget_destroy(PgtkWidget(TWinControl(sender).HANDLE)); aParent := TWinControl(sender).Parent; aParent.RemoveControl(TControl(sender)); @@ -364,6 +365,7 @@ begin begin Assert(False, 'Trace:TODO:bringtofront'); //For now just hide and show again. + end; LM_BTNDEFAULT_CHANGED : @@ -375,15 +377,16 @@ begin LM_DESTROY : begin - if (Sender is TTimer) then - begin - Assert(False, 'Trace:removing timer!!!'); - gtk_timeout_remove((Sender as TTimer).TimerID); + if (Sender is TTimer) then begin + Assert(False, 'Trace:removing timer!!!'); + gtk_timeout_remove((Sender as TTimer).TimerID); + end + else if (Sender is TWinControl) or (Sender is TCommonDialog) then begin + if Handle<>0 then + gtk_widget_destroy(PGtkWidget(Handle)); end - else if (Sender is TWinControl) or (Sender is TCommonDialog) - then gtk_widget_destroy( PGtkWidget(Handle)) else - Assert (False, Format ('Trace:Dont know how to destroy component %s', [sender.classname])); + Assert (False, Format ('Trace:Dont know how to destroy component %s', [sender.classname])); end; LM_DRAGINFOCHANGED : @@ -557,6 +560,8 @@ activate_time : the time at which the activation event occurred. LM_SetSize : begin Assert(False, Format('Trace: [TgtkObject.IntSendMessage3] %s --> LM_SetSize(%d, %d, %d, %d)', [Sender.ClassNAme, PRect(Data)^.Left,PRect(Data)^.Top,PRect(Data)^.Right,PRect(Data)^.Bottom])); +//writeln('[IntSendMessage3.lm_setsize] ',PRect(Data)^.Left,',',PRect(Data)^.Top,',', +// PRect(Data)^.Right,',',PRect(Data)^.Bottom); ResizeChild(Sender,PRect(Data)^.Left,PRect(Data)^.Top, PRect(Data)^.Right,PRect(Data)^.Bottom); end; @@ -998,22 +1003,25 @@ begin if not (Sender is TSpeedButton) then begin - pWidget := pgtkWidget(TWinControl(Sender).Handle); - gtk_widget_set_usize(pWidget, Width, Height); + pWidget := pgtkWidget(TWinControl(Sender).Handle); +//writeln('[TgtkObject.ResizeChild] ',Sender.ClassName,' ',Width,',',Height); + if Sender is TCustomForm then + //gdk_window_resize(pWidget^.Window, Width,Height); + gtk_widget_set_usize(pWidget, -1, -1); + gtk_widget_set_usize(pWidget, Width, Height); - if not ((Parent = nil) or (Sender is TCustomForm)) then - begin - pFixed := GetFixedWidget(PGtkWidget(Parent.Handle)); - if pFixed <> nil - then begin - gtk_fixed_move(pFixed, pWidget, Left, Top); - end - else Assert(False, 'Trace:ERROR!!!! - no Fixed Widget found to use when resizing....'); - end - else begin - gtk_widget_set_uposition(pWidget, Left, Top); + if not ((Parent = nil) or (Sender is TCustomForm)) then + begin + pFixed := GetFixedWidget(PGtkWidget(Parent.Handle)); + if pFixed <> nil then begin + gtk_fixed_move(pFixed, pWidget, Left, Top); + end + else Assert(False, 'Trace:ERROR!!!! - no Fixed Widget found to use when resizing....'); + end + else begin + gtk_widget_set_uposition(pWidget, Left, Top); end; - end + end; end; {------------------------------------------------------------------------------ @@ -1317,8 +1325,10 @@ begin end; LM_CHANGED : - if sender is TTrackBar - then ConnectSignal(gtk_Object(gtk_range_get_adjustment(GTK_RANGE(gObject))) , 'value_changed', @gtkvaluechanged) + if sender is TTrackBar then begin + ConnectSignal(gtk_Object(gtk_range_get_adjustment( + GTK_RANGE(gObject))) , 'value_changed', @gtkvaluechanged); + end else if sender is TNotebook then ConnectSignal(gObject, 'switch-page', @gtkswitchpage) else if sender is TCustomCombobox @@ -1942,14 +1952,12 @@ begin begin if (TScrollBar(sender).kind = sbHorizontal) then begin - Writeln('[Creating TScrollbar] Horiz'); P := gtk_hscrollbar_new(PgtkAdjustment(gtk_adjustment_new(1,TScrollBar(sender).min, TScrollBar(sender).max, TScrollBar(sender).SmallChange, TScrollBar(sender).LargeChange, TScrollBar(sender).Pagesize))); end else Begin - Writeln('[Creating TScrollbar] Vertical'); P := gtk_vscrollbar_new(PgtkAdjustment(gtk_adjustment_new(1,TScrollBar(sender).min, TScrollBar(sender).max, TScrollBar(sender).SmallChange, TScrollBar(sender).LargeChange, TScrollBar(sender).Pagesize))); @@ -2299,8 +2307,12 @@ begin Assert (Handle = nil, 'WARNING: [TgtkObject.GetValue] --> got nil pointer (no gtkobject)'); case TControl(Sender).fCompStyle of - csTrackbar : if handle <> nil then integer(data^) := round(gtk_range_get_adjustment (GTK_RANGE (handle))^.value) else - integer(data^) := 0; + csTrackbar : + if (handle <> nil) then begin + integer(data^) := round(gtk_range_get_adjustment( + GTK_RANGE (handle))^.value); + end else + integer(data^) := 0; csRadiobutton, @@ -2344,7 +2356,9 @@ begin csTrackbar : begin if Handle = nil then Exit; gtk_range_get_adjustment (GTK_RANGE (handle))^.value := integer (data^); - gtk_signal_emit_by_name (PGtkObject (gtk_range_get_adjustment (GTK_RANGE (handle))), 'value_changed'); + gtk_signal_emit_by_name (PGtkObject + (gtk_range_get_adjustment ( + GTK_RANGE (handle))), 'value_changed'); end; csRadiobutton, @@ -2758,8 +2772,8 @@ end; { ============================================================================= $Log$ - Revision 1.39 2001/03/21 23:48:29 lazarus - MG: fixed window positions + Revision 1.40 2001/03/26 14:58:31 lazarus + MG: setwindowpos + bugfixes Revision 1.36 2001/03/19 18:51:57 lazarus MG: added dynhasharray and renamed tsynautocompletion diff --git a/lcl/interfaces/gtk/gtkwinapi.inc b/lcl/interfaces/gtk/gtkwinapi.inc index 33dc0bfc0b..f986a92e09 100644 --- a/lcl/interfaces/gtk/gtkwinapi.inc +++ b/lcl/interfaces/gtk/gtkwinapi.inc @@ -337,6 +337,7 @@ begin //write('CreateBrushIndirect->'); GObject := NewGDIObject(gdiBrush); +//writeln('[TgtkObject.CreateBrushIndirect] ',HexStr(Cardinal(GObject),8)); with LogBrush do begin @@ -3040,7 +3041,9 @@ begin Adjustment := PgtkvScrollBar(handle)^.Scrollbar.Range.Adjustment; SB_CTL: if gtk_type_is_a(gtk_object_type(PGTKObject(Handle)), gtk_range_get_type) - then Adjustment := gtk_range_get_adjustment(PGTKRange(Handle)); + then begin + Adjustment := gtk_range_get_adjustment(PGTKRange(Handle)); + end; else Adjustment := nil; end; @@ -3225,12 +3228,30 @@ end; Function TgtkObject.SetWindowOrgEx(dc : hdc; NewX, NewY : Integer; Var lpPoint : TPoint) : Boolean; begin //writeln('[TgtkObject.SetWindowOrgEx] ',NewX,' ',NewY); -// gdk_window_move(pgtkwidget(PdeviceContext(dc)^.hwnd)^.window,Newx,Newy); +// ToDo: move origin + lpPoint.X := NewX; lpPoint.Y := NewY; Result := True; end; +function TgtkObject.SetWindowPos(hWnd: HWND; hWndInsertAfter: HWND; + X, Y, cx, cy: Integer; uFlags: UINT): Boolean; +//var Widget: PGTKWidget; +begin +//writeln('[TgtkObject.SetWindowPos] Top=',hWndInsertAfter=HWND_TOP); +{ Widget := GetFixedWidget(pgtkwidget(hWnd)); + if Widget = nil then Widget := pgtkwidget(hWnd); + case hWndInsertAfter of + HWND_BOTTOM: ; {gdk_window_lower(Widget^.Window);} + HWND_TOP: gtk_window_set_position(PGtkWindow(hWnd),GTK_WIN_POS_CENTER); + {gdk_window_raise(Widget^.Window);} + end; +} + + Result:=true; +end; + {------------------------------------------------------------------------------ Function: ShowCaret Params: none @@ -3425,8 +3446,8 @@ end; { ============================================================================= $Log$ - Revision 1.30 2001/03/21 23:48:29 lazarus - MG: fixed window positions + Revision 1.31 2001/03/26 14:58:31 lazarus + MG: setwindowpos + bugfixes Revision 1.26 2001/03/19 18:51:57 lazarus MG: added dynhasharray and renamed tsynautocompletion diff --git a/lcl/interfaces/gtk/gtkwinapih.inc b/lcl/interfaces/gtk/gtkwinapih.inc index cc9f9616c8..f2cc618ff1 100644 --- a/lcl/interfaces/gtk/gtkwinapih.inc +++ b/lcl/interfaces/gtk/gtkwinapih.inc @@ -92,6 +92,8 @@ Function SetTextCharacterExtra(_hdc : hdc; nCharExtra : Integer):Integer; overri function SetTextColor(DC: HDC; Color: TColorRef): TColorRef; override; function SetWindowLong(Handle: HWND; Idx: Integer; NewLong : Longint): LongInt; function SetWindowOrgEx(dc : hdc; NewX, NewY : Integer; Var lpPoint : TPoint) : Boolean; override; +function SetWindowPos(hWnd: HWND; hWndInsertAfter: HWND; + X, Y, cx, cy: Integer; uFlags: UINT): Boolean; override; function ShowCaret(hWnd: HWND): Boolean; override; function ShowScrollBar(Handle: HWND; wBar: Integer; bShow: Boolean): Boolean; override; function StretchBlt(DestDC: HDC; X, Y, Width, Height: Integer; SrcDC: HDC; XSrc, YSrc, SrcWidth, SrcHeight: Integer; Rop: Cardinal): Boolean; override; @@ -106,6 +108,9 @@ Function WindowFromPoint(Point : TPoint) : HWND; override; { ============================================================================= $Log$ + Revision 1.13 2001/03/26 14:58:32 lazarus + MG: setwindowpos + bugfixes + Revision 1.12 2001/03/13 15:02:14 lazarus MG: activated GetWindowOrgEx diff --git a/lcl/interfaces/gtk/gtkwinapiwindow.pp b/lcl/interfaces/gtk/gtkwinapiwindow.pp index 69bc6f734e..d95517eb56 100644 --- a/lcl/interfaces/gtk/gtkwinapiwindow.pp +++ b/lcl/interfaces/gtk/gtkwinapiwindow.pp @@ -266,7 +266,7 @@ end; procedure GTKAPIWidgetClient_HideCaret(Client: PGTKAPIWidgetClient); begin - if Client = nil + if Client = nil then begin WriteLn('WARNING: [GTKAPIWidgetClient_HideCaret] Got nil client'); Exit; @@ -296,7 +296,7 @@ begin Timer := 0; end; IsDrawn := False; - if BackPixmap <> nil + if (BackPixmap <> nil) and (Widget^.theStyle<>nil) then gdk_draw_pixmap( Widget^.Window, PGTKStyle(Widget^.theStyle)^.bg_gc[GTK_STATE_NORMAL], @@ -545,6 +545,9 @@ end. { ============================================================================= $Log$ + Revision 1.5 2001/03/26 14:58:32 lazarus + MG: setwindowpos + bugfixes + Revision 1.4 2001/03/13 15:02:14 lazarus MG: activated GetWindowOrgEx diff --git a/lcl/lcllinux.pp b/lcl/lcllinux.pp index ab910aa1dc..01bbdbef0b 100644 --- a/lcl/lcllinux.pp +++ b/lcl/lcllinux.pp @@ -552,6 +552,13 @@ Region_Error = Error; WS_EX_OVERLAPPEDWINDOW = (WS_EX_WINDOWEDGE or WS_EX_CLIENTEDGE); WS_EX_PALETTEWINDOW = (WS_EX_WINDOWEDGE or WS_EX_TOOLWINDOW or WS_EX_TOPMOST); +const + { SetWindowPos Flags } + HWND_TOP = 0; + HWND_BOTTOM = 1; + HWND_TOPMOST = HWND(-1); + HWND_NOTOPMOST = HWND(-2); + type @@ -1371,6 +1378,9 @@ end. { $Log$ + Revision 1.6 2001/03/26 14:58:31 lazarus + MG: setwindowpos + bugfixes + Revision 1.5 2001/02/01 16:45:19 lazarus Started the code completion. Shane