Главная страница
Top.Mail.Ru    Яндекс.Метрика
Текущий архив: 2013.07.28;
Скачать: CL | DM;

Вниз

TabControl Pages   Найти похожие ветки 

 
Jon ©   (2008-01-19 19:10) [0]

Is it possible to dynamically show / hide individual pages in Tab Control?


 
Jon ©   (2008-01-22 02:13) [1]

Ah, I found a solution:
Remove: RemovedPage := TabControl.TC_Remove(0);
Insert: TabControl.TC_InsertControl(0,"Tab",0,RemovedPage);

Now a question on keyboard use:

How can I enable CTRL+TAB and SHIFT+CTRL+TAB to navigate tabs (just like VCL)?
Or do I have to code my own routine?
I thought that Tabulate would support this.


 
Dimaxx ©   (2008-01-22 13:57) [2]

By default use Ctrl+PgDn & Ctrl+PgUp to navigate tabs.


 
Jon ©   (2008-01-22 14:56) [3]

I have tried but it does not work.
Is there an option to enable it?
I have tried with KOL and KOL+MCK.


 
Dimaxx ©   (2008-01-23 10:06) [4]

Maybe Tabulate or TabulateEx?


 
Jon ©   (2008-01-23 11:49) [5]

No, neither of those work.
Any other suggestions?


 
Dimaxx ©   (2008-01-23 21:58) [6]

I have no idea... :(


 
Jon ©   (2008-01-24 04:19) [7]

Now trying to modify Tabulate2Control in KOL.PAS
Problem is that I break standard tabulate functions
The TAB key cannot be processed with key preview enabled
My attempts at sub-classing TabControl also unsuccessful
Is the keyboard handling for this control a bug or by design?


 
Jon ©   (2008-01-27 22:10) [8]

Modifying KOL.PAS did not help.
I am willing to try suggestions from this forum.


 
Jon ©   (2008-01-29 03:16) [9]

Bug with TabControl:

>     function TC_DisplayRect: TRect;
>     {* |<#tabcontrol>
>        Returns rectangle, occupied by a page rather then tab. }

Result.Top and Result.Bottom include height of tab too.


 
имя   (2008-08-08 16:13) [10]

Удалено модератором


 
Jon ©   (2008-11-08 16:08) [11]


> How can I enable CTRL+TAB and SHIFT+CTRL+TAB to navigate tabs (just like VCL)?

I am still looking for a solution if anyone has suggestions.


 
Jon ©   (2009-05-18 16:52) [12]

> How can I enable CTRL+TAB and SHIFT+CTRL+TAB to navigate tabs (just like VCL)?


Can anyone please provide any help? Multi-tabbed applications are common nowadays and I would love to have this feature added to KOL.


 
Дмитрий К ©   (2009-05-18 18:22) [13]

program Project1;

uses
 Windows, Messages, KOL;
type
 PForm1 = ^TForm1;
 TForm1 = object(TObj)
 private
   Form, TC: PControl;
   function FormMessage(var Msg: TMsg; var Rslt: Integer): Boolean;
   procedure SwitchTab(Down: Boolean);
 end;

var
 Form1: PForm1;
 KBHook: HHook;
const
 WM_SWITCHTAB = WM_USER + $400;

function NewForm1(AParent: PControl): PForm1;
var i: Integer;
begin
 New(Result, Create);
 with Result^ do
 begin
   Form := NewForm(AParent, "Form1");
   Form.Add2AutoFree(Result);
   TC := NEwTabControl(Form, ["0","1","2","3","4"], [], nil, 0).SetAlign(caCLient);
   for i := 0 to 4 do
   begin
     NewLabel(TC.TC_Pages[i], "Label "+ int2str(i));
   end;
   Form.OnMessage := FormMessage;
 end;
end;

function TForm1.FormMessage(var Msg: TMsg; var Rslt: Integer): Boolean;
begin
 Result := False;
 case Msg.message of
   WM_SWITCHTAB: SwitchTab(Boolean(Msg.wParam));
 end;
end;

procedure TForm1.SwitchTab(Down: Boolean);
begin
 if Down then
 begin
   if TC.CurIndex = 0 then
     TC.CurIndex := TC.Count - 1
   else
     TC.CurIndex := TC.CurIndex - 1
 end
 else
   if TC.CurIndex = TC.Count - 1 then
     TC.CurIndex := 0
   else
     TC.CurIndex := TC.CurIndex + 1

end;

function KeybProc(Code: Integer; wParam, lParam: Integer): Integer; stdcall;
begin
 if Code >= 0 then
 begin
   if (wParam = VK_TAB) and (lParam and $80000000 = 0) then
   begin
     if GetKeyState(VK_CONTROL) and $8000 = $8000 then
       Form1.Form.Perform(WM_SWITCHTAB, (GetKeyState(VK_SHIFT) and $8000) shr 15, 0);
   end;
 end;
 Result := CallNextHookEx(KBHook, Code, wParam, lParam);
end;

begin
 Form1 := NewForm1(nil);
 Applet := Form1.Form;
 KBHook := SetWindowsHookEx(WH_KEYBOARD, KeybProc, 0, GetCurrentThreadID);
 if KBHook = 0 then
   MsgOK(SysErrorMessage(GetLastError));

 Run(Applet);
 UnhookWindowsHookEx(KBHook);
end.


 
Jon ©   (2009-05-18 19:55) [14]

Ah, hooks! Thank you very much Dmitry, I really appreciate the help.


 
имя   (2009-07-17 09:30) [15]

Удалено модератором


 
имя   (2009-07-17 09:30) [16]

Удалено модератором



Страницы: 1 вся ветка

Текущий архив: 2013.07.28;
Скачать: CL | DM;

Наверх




Память: 0.5 MB
Время: 0.006 c
2-1353496539
Xmen
2012-11-21 15:15
2013.07.28
Работа с потоком как организовать?


15-1362488545
fpc_user
2013-03-05 17:02
2013.07.28
Существует ли современная безплатная Delphi ?


15-1362342603
Юрий
2013-03-04 00:30
2013.07.28
С днем рождения ! 4 марта 2013 понедельник


2-1354379243
Аскалот
2012-12-01 20:27
2013.07.28
Неопознанная ошибка


11-1200759004
Jon
2008-01-19 19:10
2013.07.28
TabControl Pages