PDA

View Full Version : Selection information on TAB?



PICTRIX
01-05-2006, 06:46 AM
We will ask it.
In the tool plug-in, I want to know selection information on TAB in
XPanel.
I want to know which group in TAB to have selected.
Is it possible?

GregMalick
01-05-2006, 09:09 AM
Clicking on a TAB triggers the xgetval() routine.
I suppose you could set a switch in there.

Opps - no I tested it and every control is triggered in that routine.

Maybe the ui_chgnotify() routine can somehow be used?
hmmm...nothing coming back unique there.

I would say this is not looking good for you.

PICTRIX
01-06-2006, 02:52 AM
Thank you GregMalick

LWXPanelChangeNotifyFunc was not able to be used with the LWXP_VIEW panel.
Information on TAB seems not to come even to the Set callback.
Is the value set by the hint?
It doesn't understand.


Clicking on a TAB triggers the xgetval() routine.
I suppose you could set a switch in there.

Where is the xgetval()?
It is interested.
Please teach if it is good.

PICTRIX
01-06-2006, 08:15 AM
Yahhor !!!!!
There was a hint in your word.
This problem is a solution.
Thank you !!!
It was able to know the TAB selection item by the hint item of Xpanel.

Should I describe the method in this place?
Manners of the bulletin board are not understood.

GregMalick
01-06-2006, 10:53 AM
You should always describe the solution so that others can learn. :angel:

In about a year - someone else will post a "Thank You".

jeremyhardin
01-06-2006, 12:04 PM
won't take me a year to say thanks :D...

GregMalick
01-06-2006, 05:39 PM
Aloha jeremy!

That was kind of an inside joke.
Check out post #11 in this thread (http://www.newtek.com/forums/showthread.php?t=29153)

:D

jeremyhardin
01-06-2006, 06:06 PM
haha. pardon my intrusion :D

PICTRIX
01-06-2006, 07:00 PM
Okay.
In my word, I think that it is confused.
The sample code was written.
The page number of selected TAB enters int tabpage.
When this value is changed, the TAB display is changed.



int tabpage;

enum {
ID_C1 = 0x8001,
ID_C2,
ID_C3,
ID_C4,
ID_GROUP1,
ID_GROUP2,

ID_TAB,
ID_TABPAGE,
};


static void * Get( void *mv, unsigned long vid )
{
switch ( vid ){
case ID_TABPAGE:
return &tabpage;
-
-
}
-
-
}

static LWXPRefreshCode Set( void *mv, unsigned long vid, void *value )
{
switch ( vid ){
case ID_TABPAGE:
i = ( int * ) value;
tabpage = *i;
break;
-
-
}
-
-
}

LWXPanelID Panel( MyData *dt )
{
static LWXPanelControl ctl[] = {
{ ID_C1, "Control 1", "integer" },
{ ID_C2, "Control 2", "integer" },
{ ID_C3, "Control 3", "integer" },
{ ID_C1, "Control 4", "integer" },
{ ID_TABPAGE, "--hidden--", "integer" }, // <<<<<<
{ 0 }
};
static LWXPanelDataDesc cdata[] = {
{ ID_C1, "Control 1", "integer" },
{ ID_C2, "Control 2", "integer" },
{ ID_C3, "Control 3", "integer" },
{ ID_C1, "Control 4", "integer" },
{ ID_TABPAGE, "--hidden--", "integer" }, // <<<<<<
{ 0 }
};
LWXPanelHint hint[] = {
XpGROUP_( ID_GROUP1 ), XpH( ID_C1 ), XpH( ID_C2 ), XpEND,
XpGROUP_( ID_GROUP2 ), XpH( ID_C3 ), XpH( ID_C4 ), XpEND,
XpLABEL( ID_GROUP1, "page 1" ),
XpLABEL( ID_GROUP2, "page 2" ),
XpTABS_( ID_TAB ), XpH( ID_GROUP1 ), XpH( ID_GROUP2 ), XpEND,

XpVALUE( ID_TAB, ID_TABSPAGE ), // <<<<<<
XpDELETE( ID_TABPAGE ), // <<<<<<<
XpEND,
};

panel = xpanf->create( LWXP_VIEW, ctl );
if ( !panel ) return NULL;

xpanf->describe( panel, cdata, Get, Set );
xpanf->hint( panel, 0, hint );
return panel;
}

Nitisara
01-07-2006, 07:39 PM
The sample code was written.

These commands are not necessary:

{ ID_TABPAGE, "--hidden--", "integer" }, // <<<<<<
XpDELETE( ID_TABPAGE ), // <<<<<<<

So you will have:

LWXPanelID Panel( MyData *dt )
{
static LWXPanelControl ctl[] = {
{ ID_C1, "Control 1", "integer" },
{ ID_C2, "Control 2", "integer" },
{ ID_C3, "Control 3", "integer" },
{ ID_C1, "Control 4", "integer" },
{ 0 }
};
static LWXPanelDataDesc cdata[] = {
{ ID_C1, "Control 1", "integer" },
{ ID_C2, "Control 2", "integer" },
{ ID_C3, "Control 3", "integer" },
{ ID_C1, "Control 4", "integer" },
{ 0 }
};
LWXPanelHint hint[] = {
XpGROUP_( ID_GROUP1 ), XpH( ID_C1 ), XpH( ID_C2 ), XpEND,
XpGROUP_( ID_GROUP2 ), XpH( ID_C3 ), XpH( ID_C4 ), XpEND,
XpLABEL( ID_GROUP1, "page 1" ),
XpLABEL( ID_GROUP2, "page 2" ),
XpTABS_( ID_TAB ), XpH( ID_GROUP1 ), XpH( ID_GROUP2 ), XpEND,

XpVALUE( ID_TAB, ID_TABPAGE ), // <<<<<<
XpEND,
};

PICTRIX
01-07-2006, 09:18 PM
These commands are not necessary:

{ ID_TABPAGE, "--hidden--", "integer" }, // <<<<<<
XpDELETE( ID_TABPAGE ), // <<<<<<<



Hello Nitisara ,
I tried.
What you say is correct.
Thank you.

GregMalick
01-07-2006, 10:15 PM
Aren't those two static arrays supposed to be defining:

ID_C1,
ID_C2,
ID_C3,
ID_C4,


:D

PICTRIX
01-08-2006, 07:47 PM
It was left by the copy paste. :D

GregMalick
01-08-2006, 08:12 PM
Aloha PICTRIX,

I figured it was something like that.

I'm pointing it out for the newbies that might think it was a programming trick that they couldn't get to work. :yingyang:

PICTRIX
01-08-2006, 09:10 PM
I wish to express my gratitude for your consideration. :thumbsup:
My check was loose. :thumbsdow

PICTRIX
01-09-2006, 07:04 AM
Why does not the person of NewTek teach?
My question.

Nitisara
01-09-2006, 07:30 AM
kono forumu wa oshieru-koto no dewa arimasen
useru forumu des :)

GregMalick
01-09-2006, 08:51 AM
Why does not the person of NewTek teach?
My question.


Good Question.

my Answer:There are too few plugin developers to bother.


Answer based upon:Low posting activity in the "LW Plugin Developer's Forum" on Yahoo.


Supporting clues: LScript also gets very little attention.


Silver lining to this cloud:NT Developers are improving LW.

PICTRIX
01-10-2006, 02:18 AM
Nitisara-san,
henji wo arigato gozaimasu. mata osiete kudasai ne :help:

Mr.GregMalick,
It is habitat segregation.
It consented. :thumbsup:
This following also help me.

Nitisara
01-10-2006, 07:14 PM
mata osiete kudasai ne
pictrix san, can you please tell what you want to know?
i tried this code example which you gave, and it worked nicely.

PICTRIX
01-11-2006, 02:48 AM
Mr.Nitisara ,
My word seems to have been insufficient.
I'm sorry.
My best regards at that time when I have another question.

kono tugi mo onegai simasu :)