Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
1 registered members (TipmyPip), 18,546 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 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 | 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