Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (Akow), 1,361 guests, and 9 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19055 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