PageControl with tab-moving
#1
Posted 21 April 2006 - 11:26 AM
I really miss the option to change the tab order at runtime.
The user needs to drag&drop tabs to a different location.
Would be great to have that
greetz
Steffen
#2
Posted 21 April 2006 - 02:48 PM
I will add this for surre
regards
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.
#3
Posted 26 March 2007 - 11:10 PM
just wanting to ask for the status on that.
Would be a really nice thing!
greetz
Steffen
#4
Posted 27 March 2007 - 05:38 PM
It is still in progress, I hope that I will finish it soon.
regards
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.
#5
Posted 26 June 2007 - 05:56 PM
begin
if NxPageControl1.GetTabAtPos(X, Y) <> nil then // <---- added by Boki
begin
if Button = mbLeft then NxPageControl1.BeginDrag(false, 5);
end;
end;
procedure TfrmMain.NxPageControl1DragDrop(Sender, Source: TObject; X, Y: Integer);
var
ts: TnxTabSheet;
begin
if (Sender = Source) then
begin
ts := TNxPageControl(Sender).GetTabAtPos(X, Y);
if Assigned(ts) then // <--- added by Boki
if (ts.PageIndex >= 0) and (ts.PageIndex < TNxPageControl(Sender).PageCount) then
TNxPageControl(Sender).ActivePage.PageIndex := ts.PageIndex;
end
end;
procedure TfrmMain.NxPageControl1DragOver(Sender, Source: TObject; X, Y: Integer; State: TDragState; var Accept: Boolean);
begin
Accept := Source is TNxPageControl;
end;
#6
Posted 12 July 2007 - 01:18 PM
I have do some modifications in your code. I hope that now all work fine. Thank you again.
Best regards
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.
#7
Posted 12 July 2007 - 02:22 PM
Thanks...
#8
Posted 04 August 2007 - 04:50 PM
when will it be?
#9
Posted 07 August 2007 - 04:40 PM
bcoz i dont see this change in the live update post
#10
Posted 07 August 2007 - 05:00 PM
I will not be added yet. Internaly this will be done without standard Drag & Drop.
Best regards
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.
#11
Posted 07 August 2007 - 05:18 PM
#12
Posted 07 August 2007 - 05:25 PM
It will act similar but without using Drag & Drop, it will draw arrows instead similar to NextGrid columns moving.
Best regards
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.
#13
Posted 29 January 2014 - 03:14 PM
//Using D2007 and NextSuite 5 1.2014
//Can't find option tab-moving in NxPageControl
//Based on above Drag & Drop suggestion, here is a method for tab-moving with visual feedback of the tab...
//-----------------
//2 global var needed
//first tab is on the form, new tabs are created at runtime (based on count of files...)
var
iLDownMB: integer;
iLDraggingMB : integer;
//-----------------
procedure FocusFirstEntryControl(ContainerToFocus : TWinControl) ;
var
i : integer;
begin
for i := 0 to ContainerToFocus.ControlCount - 1 do
begin
if (ContainerToFocus.Controls[i] is TWinControl) then
begin
TWinControl(ContainerToFocus.Controls[i]).SetFocus;
Break;
end;
end;
end;
//-----------------
procedure TfrmMain.NxPageControl1MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
iLDownMB:= 0;
iLDraggingMB := 1;
if (Button = mbLeft) then
begin
iLDownMB:= 1;
iLDraggingMB := 0;
end
else
begin
if (Button = mbRight) then
begin
iLDownMB:= 0;
iLDraggingMB := 1;
end;
end;
end;
//-----------------
procedure TfrmMain.NxPageControl1MouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
if (Button = mbLeft) then
begin
iLDownMB:= 0;
iLDraggingMB := 1;
case NxPageControl1.ActivePageIndex of
0 :
begin
// custom code for the first tab ...
end;
else
begin
//focus on the other tabs created at runtime
FocusFirstEntryControl(NxPageControl1.ActivePage);
end;
end;
end;
if (Button = mbRight) then
begin
iLDownMB:= 0;
iLDraggingMB := 1;
// a popup comes here for example
end;
end;
//-----------------
procedure TfrmMain.NxPageControl1MouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);
begin
if (NxPageControl1.PageCount > 1) then // do nothing for the first tab = no moving allowed
begin
if (iLDownMB = 1) then
begin
if (iLDraggingMB = 0) then
begin
iLDraggingMB := 1;
case NxPageControl1.ActivePageIndex of
0 :
begin
//
end;
else
begin
if NxPageControl1.GetTabAtPos(X, Y) <> nil then // <---- added by Boki
begin
NxPageControl1.BeginDrag(false, 5);
end;
end;
end;
end;
end;
end;
//-----------------
procedure TfrmMain.NxPageControl1DragOver(Sender, Source: TObject; X, Y: Integer; State: TDragState; var Accept: Boolean);
var
ts: TnxTabSheet;
begin
//Source = NxPageControl1 --> several PageControls on the form
if (Source = NxPageControl1) and (Sender = Source) then
begin
case TNxPageControl(Sender).ActivePageIndex of
0 :
begin
//nothing allowed for the first tab
Accept := False;
end;
else
begin
Accept := True;
ts := TNxPageControl(Sender).GetTabAtPos(X, Y);
if Assigned(ts) then // <--- added by Boki
if (ts.PageIndex > 0) and
(ts.PageIndex < TNxPageControl(Sender).PageCount) and
(ts.PageIndex <> TNxPageControl(Sender).ActivePage.PageIndex) then
begin
TNxPageControl(Sender).ActivePage.PageIndex := ts.PageIndex;
end;
end;
end;
end
else
begin
//another drag & drop from another component
if (Source = NextGrid1) then
begin
//
end;
end;
end;
//-----------------
procedure TfrmMain.NxPageControl1lDragDrop(Sender, Source: TObject; X, Y: Integer);
begin
if (Source = NxPageControl1) and (Sender = Source) then
begin
case TNxPageControl(Sender).ActivePageIndex of
0 :
begin
//custom method for the first tab
end;
else
begin
FocusFirstEntryControl(NxPageControl1.ActivePage);
end;
end;
end
else
begin
//another drag & drop from another component
if (Source = NextGridMB) then
begin
//
end;
end;
end;
//-----------------
Regards,
Jan Maryssael
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users