mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-06 16:00:44 +02:00
convert LM_MOVEPAGE message to interface method
git-svn-id: trunk@6071 -
This commit is contained in:
parent
46c5e54090
commit
c5832cd817
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user