Gamestudio Links
Zorro Links
Newest Posts
loading historical data 1st time
by AndrewAMD. 04/14/23 12:54
Trade at bar open
by juanex. 04/13/23 19:43
Bug in Highpass2 filter
by rki. 04/13/23 09:54
Adding Limit Orders For IB
by scatters. 04/11/23 16:16
FisherN
by rki. 04/11/23 08:38
AUM Magazine
Latest Screens
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Hecknex World
Who's Online Now
3 registered members (AndrewAMD, Grant, Neb), 908 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
rki, FranzIII, indonesiae, The_Judge, storrealba
18919 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
check panels for buttons #402479
06/06/12 07:57
06/06/12 07:57
Joined: Apr 2008
Posts: 245
GameScore Offline OP
Member
GameScore  Offline OP
Member

Joined: Apr 2008
Posts: 245
is it possible to check a panel for buttons?
i want to find out how many buttons a panel have

Re: check panels for buttons [Re: GameScore] #402480
06/06/12 08:05
06/06/12 08:05
Joined: Mar 2006
Posts: 1,993
Karlsruhe
PadMalcom Offline
Serious User
PadMalcom  Offline
Serious User

Joined: Mar 2006
Posts: 1,993
Karlsruhe
pan_setbutton returns a number of a button and 0 if it was not found. Itarate from 1 to n until pan_setbutton returns 0.

Re: check panels for buttons [Re: PadMalcom] #402483
06/06/12 08:58
06/06/12 08:58
Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
Espér Offline
Expert
Espér  Offline
Expert

Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
i think something like this should work:
Code:
function pan_checkbuttons(PANEL* parapan, var hiver)
{
    var buttcount = 0
    var hivecount =1;
    for(hivecount=1; hivecount <= hiver; hivecount ++)
    {
        if(pan_setbutton(parapan, hivecount, 0,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL) == 0)
        {hivecount = hiver+2;}
        else
        {buttcount +=1;}
    }
    return(buttcount);
}


or
Code:
function pan_checkbuttons(PANEL* parapan)
{
    var buttcount = 0
    var hivecount =1;
    while(1)
    {
        if(pan_setbutton(parapan, hivecount, 0,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL) == 0)
        {break;}
        else
        {buttcount +=1; hivecount +=1;}
    }
    return(buttcount);
}





Problem are the the pan_setbutton arguments.. i don't know if they work with NULL ^^"

not tested, written on iPhone.

Last edited by Espér; 06/06/12 09:09.

Selling my Acknex Engine Editions (A7 Com & A8 Pro):
>> click here if you are interested <<

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1