diff --git a/lcl/include/customnotebook.inc b/lcl/include/customnotebook.inc index 8703bf6a2b..b33047e0a8 100644 --- a/lcl/include/customnotebook.inc +++ b/lcl/include/customnotebook.inc @@ -142,7 +142,6 @@ end; procedure TNBPages.Move(CurIndex, NewIndex: Integer); var APage: TCustomPage; - Msg: TLMNotebookEvent; NewControlIndex, NewPageIndex: integer; begin if CurIndex=NewIndex then exit; @@ -177,12 +176,7 @@ begin if FNoteBook.HandleAllocated and (not (csLoading in FNoteBook.ComponentState)) then begin - Msg.Parent := TControl(fNotebook); - Msg.Child := APage; - Msg.fCompStyle := fNotebook.fCompStyle; - Msg.Page := NewIndex; - - CNSendMessage(LM_MOVEPAGE, fNotebook, @Msg); + TWSCustomNotebookClass(FNotebook.WidgetSetClass).MovePage(FNotebook, APage, NewIndex); end; // update PageIndex @@ -788,6 +782,9 @@ end;} { ============================================================================= $Log$ + Revision 1.63 2004/09/24 19:02:38 micha + convert LM_MOVEPAGE message to interface method + Revision 1.62 2004/09/24 18:00:51 micha convert LM_NB_UPDATETAB message to interface method diff --git a/lcl/interfaces/gtk/gtkint.pp b/lcl/interfaces/gtk/gtkint.pp index d325886ddf..ffffbbca63 100644 --- a/lcl/interfaces/gtk/gtkint.pp +++ b/lcl/interfaces/gtk/gtkint.pp @@ -206,7 +206,6 @@ type // notebook procedure AddDummyNoteBookPage(NoteBookWidget: PGtkNoteBook);virtual; - procedure MoveNBPage(ANoteBook, APage: TObject; NewIndex: Integer);virtual; // forms and dialogs procedure BringFormToFront(Sender: TObject); @@ -433,6 +432,9 @@ end. { ============================================================================= $Log$ + Revision 1.215 2004/09/24 19:02:38 micha + convert LM_MOVEPAGE message to interface method + Revision 1.214 2004/09/24 18:00:51 micha convert LM_NB_UPDATETAB message to interface method diff --git a/lcl/interfaces/gtk/gtkobject.inc b/lcl/interfaces/gtk/gtkobject.inc index ab4571780b..8000ff12a2 100644 --- a/lcl/interfaces/gtk/gtkobject.inc +++ b/lcl/interfaces/gtk/gtkobject.inc @@ -3030,22 +3030,10 @@ begin LM_Create : CreateComponent(Sender); else - begin - Case LM_Message of - - LM_MovePage : - if Sender is TCustomNoteBook then begin - MoveNBPage(TControl(Sender), TLMNotebookEvent(Data^).Child, - TLMNotebookEvent(Data^).Page); - end; - - else + // unhandled message if Sender<>nil then Assert(True, Format('WARNING: Unhandled message %d in IntSendMessage3' +'send by %s --> message:Redraw', [LM_Message, Sender.ClassName])); - // unhandled message - end; // end of 2nd case - end; // end of else-part of 1st case end; // end of 1st case end; @@ -5737,21 +5725,6 @@ begin end; end; -{------------------------------------------------------------------------------ - procedure TGtkWidgetSet.MoveNBPage(ANoteBook, APage: TObject; NewIndex: Integer); - - Move a notebook page. -------------------------------------------------------------------------------} -procedure TGtkWidgetSet.MoveNBPage(ANoteBook, APage: TObject; NewIndex: Integer); -var - NoteBookWidget: PGtkNotebook; -begin - NoteBookWidget:=PGtkNotebook(TWinControl(ANoteBook).Handle); - gtk_notebook_reorder_child(NoteBookWidget, - PGtkWidget(TWinControl(APage).Handle),NewIndex); - UpdateNoteBookClientWidget(ANoteBook); -end; - {------------------------------------------------------------------------------ Method: TGtkWidgetSet.SetPixel Params: Sender : the lcl object which called this func via SendMessage @@ -7003,6 +6976,9 @@ end; { ============================================================================= $Log$ + Revision 1.602 2004/09/24 19:02:38 micha + convert LM_MOVEPAGE message to interface method + Revision 1.601 2004/09/24 18:00:52 micha convert LM_NB_UPDATETAB message to interface method diff --git a/lcl/interfaces/gtk/gtkwsextctrls.pp b/lcl/interfaces/gtk/gtkwsextctrls.pp index c7df533651..fb72c9ade1 100644 --- a/lcl/interfaces/gtk/gtkwsextctrls.pp +++ b/lcl/interfaces/gtk/gtkwsextctrls.pp @@ -53,8 +53,12 @@ type private protected public - class procedure AddPage(const ANotebook: TCustomNotebook; const AChild: TCustomPage; const AIndex: integer); override; - class procedure RemovePage(const ANotebook: TCustomNotebook; const AIndex: integer); override; + class procedure AddPage(const ANotebook: TCustomNotebook; + const AChild: TCustomPage; const AIndex: integer); override; + class procedure MovePage(const ANotebook: TCustomNotebook; + const AChild: TCustomPage; const NewIndex: integer); override; + class procedure RemovePage(const ANotebook: TCustomNotebook; + const AIndex: integer); override; class function GetNotebookMinTabHeight(const AWinControl: TWinControl): integer; override; class function GetNotebookMinTabWidth(const AWinControl: TWinControl): integer; override; @@ -538,6 +542,16 @@ begin UpdateNoteBookClientWidget(ANoteBook); end; +procedure TGtkWSCustomNotebook.MovePage(const ANotebook: TCustomNotebook; + const AChild: TCustomPage; const NewIndex: integer); +var + NoteBookWidget: PGtkNotebook; +begin + NoteBookWidget:=PGtkNotebook(ANoteBook.Handle); + gtk_notebook_reorder_child(NoteBookWidget, PGtkWidget(AChild.Handle), NewIndex); + UpdateNoteBookClientWidget(ANoteBook); +end; + procedure TGtkWSCustomNotebook.RemovePage(const ANotebook: TCustomNotebook; const AIndex: integer); begin diff --git a/lcl/interfaces/win32/win32wsextctrls.pp b/lcl/interfaces/win32/win32wsextctrls.pp index c78741e59c..a4cc50df1c 100644 --- a/lcl/interfaces/win32/win32wsextctrls.pp +++ b/lcl/interfaces/win32/win32wsextctrls.pp @@ -54,8 +54,13 @@ type private protected public - class procedure AddPage(const ANotebook: TCustomNotebook; const AChild: TCustomPage; const AIndex: integer); override; - class procedure RemovePage(const ANotebook: TCustomNotebook; const AIndex: integer); override; + class procedure AddPage(const ANotebook: TCustomNotebook; + const AChild: TCustomPage; const AIndex: integer); override; + class procedure MovePage(const ANotebook: TCustomNotebook; + const AChild: TCustomPage; const NewIndex: integer); override; + class procedure RemovePage(const ANotebook: TCustomNotebook; + const AIndex: integer); override; + class procedure SetPageIndex(const ANotebook: TCustomNotebook; const AIndex: integer); override; class procedure SetTabPosition(const ANotebook: TCustomNotebook; const ATabPosition: TTabPosition); override; class procedure ShowTabs(const ANotebook: TCustomNotebook; AShowTabs: boolean); override; @@ -295,6 +300,12 @@ begin End; end; +procedure TWin32WSCustomNotebook.MovePage(const ANotebook: TCustomNotebook; + const AChild: TCustomPage; const NewIndex: integer); +begin + // TODO: implement me! +end; + procedure TWin32WSCustomNotebook.RemovePage(const ANotebook: TCustomNotebook; const AIndex: integer); begin diff --git a/lcl/lmessages.pp b/lcl/lmessages.pp index ea7b2bd2fa..7efcd262a1 100644 --- a/lcl/lmessages.pp +++ b/lcl/lmessages.pp @@ -576,20 +576,6 @@ type TLMRButtonUp = TLMMouse; TLMMButtonUp = TLMMouse; - TLMNotebookEvent = record - Parent: TObject; - Child: TObject; - fCompStyle: Integer; - Str: String; - Page: Integer; - TabPosition: Pointer; - end; - - TLMSetChecked = record - Index : integer; - Checked : boolean; - end; - TLMSetFocus = packed record Msg: Cardinal; FocusedWnd: HWND; @@ -817,6 +803,9 @@ end. { $Log$ + Revision 1.123 2004/09/24 19:02:38 micha + convert LM_MOVEPAGE message to interface method + Revision 1.122 2004/09/24 18:00:51 micha convert LM_NB_UPDATETAB message to interface method diff --git a/lcl/widgetset/wsextctrls.pp b/lcl/widgetset/wsextctrls.pp index 7ae88caf75..5917a0ec5a 100644 --- a/lcl/widgetset/wsextctrls.pp +++ b/lcl/widgetset/wsextctrls.pp @@ -60,6 +60,7 @@ type TWSCustomNotebook = class(TWSWinControl) class procedure AddPage(const ANotebook: TCustomNotebook; const AChild: TCustomPage; const AIndex: integer); virtual; + class procedure MovePage(const ANotebook: TCustomNotebook; const AChild: TCustomPage; const NewIndex: integer); virtual; class procedure RemovePage(const ANotebook: TCustomNotebook; const AIndex: integer); virtual; class function GetNotebookMinTabHeight(const AWinControl: TWinControl): integer; virtual; @@ -185,6 +186,20 @@ procedure TWSCustomNotebook.AddPage(const ANotebook: TCustomNotebook; const AChi begin end; +{------------------------------------------------------------------------------ + Method: TWSCustomNotebook.MovePage + Params: ANotebook - The notebook control + AChild - The page to move + NewIndex - The new index of the page + Returns: Nothing + + Moves a page in a notebook control + ------------------------------------------------------------------------------} +procedure TWSCustomNotebook.MovePage(const ANotebook: TCustomNotebook; + const AChild: TCustomPage; const NewIndex: integer); +begin +end; + {------------------------------------------------------------------------------ Method: TWSCustomNotebook.RemovePage Params: ANotebook - The notebook control