Hi,
just a comment -
to navgate between text entries you can also use arrow keys.
When cursor goes out of text entry one of the signals emitted:
CursorOutLeft,CursorOutRight,CursorOutUp,CursorOutDown
The following small macro demonstrates how it works
////////////////// testentry.C ///////////////////////////////
{
TGMainFrame* main = new TGMainFrame(gClient->GetRoot(),650,270);
main->SetWindowName("Use arrow-keys to navigate between text entries");
main->SetIconName("Use arrow-keys to navigate between text entries");
TGTextEntry* entry[16];
for(int i=0; i<16; i++) {
int x = i%4;
int y = (i-x)/4;
entry[i] = new TGTextEntry(main,"");
entry[i]->Resize(100,20);
entry[i]->Move(150*x+50,50*y+50);
}
for(int i=0; i<16; i++) {
int x = i%4;
int y = (i-x)/4;
if(x<3)
entry[i]->Connect("CursorOutRight","TGTextEntry",entry[i+1],"SetFocus()");
if(x>0)
entry[i]->Connect("CursorOutLeft","TGTextEntry",entry[i-1],"SetFocus()");
if(y<3)
entry[i]->Connect("CursorOutDown","TGTextEntry",entry[(y+1)*4+x],"SetFocus()");
if(y>0)
entry[i]->Connect("CursorOutUp","TGTextEntry",entry[(y-1)*4+x],"SetFocus()");
}
main->MapSubwindows();
main->MapRaised();
main->SetWMPosition(300,300);
}
Just run root
*******************************************
* *
* W E L C O M E to R O O T *
* *
* Version 3.01/06 21 August 2001 *
* *
* You are welcome to visit our Web site *
* http://root.cern.ch *
* *
*******************************************
FreeType Engine v1.x used to render TrueType fonts.
Compiled with thread support.
CINT/ROOT C/C++ Interpreter version 5.15.09, Aug 6 2001
Type ? for help. Commands must be C++ statements.
Enclose multiple statements between { }.
root [0] .x testentry.C
Regards. Valeriy
Christian Holm Christensen wrote:
>
>
> Hi Chris,
>
> On Thu, 13 Sep 2001 14:38:39 +0100 (BST)
> Chris Milne <phycm@phy.hw.ac.uk> wrote
> concerning "[ROOT] Tabbing between text elements":
> > Hi there,
> >
> > I have a class (see below), which creates a dialog box with 5 text
> > entry boxes, however, I was wondering if there is a way to allow the
> > user to Tab between these elements, and also allow them to simply
> > hit return to answer OK. I know that dialogs.C allows the user to
> > simply hit return, but there is what I based my code on! >
> >
> > Any ideas
>
> This question was answered by Fons on roottalk exactly 30 days
> ago. See
>
> http://root.cern.ch/root/roottalk/roottalk01/2896.html
>
> Yours,
>
This archive was generated by hypermail 2b29 : Tue Jan 01 2002 - 17:50:59 MET