Gamestudio Links
Zorro Links
Newest Posts
ZorroGPT
by TipmyPip. 03/01/26 16:40
WFO Training with parallel cores Zorro64
by Martin_HH. 02/26/26 16:03
Zorro version 3.0 prerelease!
by TipmyPip. 02/25/26 16:38
Camera always moves upwards?
by clonman. 02/21/26 09:29
Sam Foster Sound | Experienced Game Composer for Hire
by titanicpiano14. 02/19/26 13:22
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
3 registered members (Quad, TipmyPip, Grant), 5,429 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
the1, alx, ApprenticeInMuc, PatrickH90, USER0328
19200 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 3 1 2 3
Panel in C++: how to create / display? #190457
03/27/08 01:59
03/27/08 01:59
Joined: Feb 2008
Posts: 23
Sjlver Offline OP
Newbie
Sjlver  Offline OP
Newbie

Joined: Feb 2008
Posts: 23
How do we create and display a PANEL in C++?

We tried different approaches, for example this one:

Code:

PANEL* menu = pan_create(NULL, _VAR(100));
menu->flags |= VISIBLE;
menu->alpha = _VAR(100);
menu->size_x = _VAR(10);
menu->size_y = _VAR(10);
menu->red = _VAR(100);
menu->pos_x = _VAR(200);
menu->pos_y = _VAR(200);



The pan_create function does return a valid pointer (not null), but no matter what we try, we don't get that panel to display...

Thanks for all help or sample code!
Jonas & his desperate team ;-)

Re: Panel in C++: how to create / display? [Re: Sjlver] #190458
03/27/08 10:52
03/27/08 10:52
Joined: Dec 2003
Posts: 521
LazyDog Offline
User
LazyDog  Offline
User

Joined: Dec 2003
Posts: 521
delphi example but should give you the idea-- you need to pass the parameters in a string--make sure you put the ";" at the end!

Code:

Panel2 := pan_create('bmap = levelcode3.pcx;pos_x = 325;
pos_y = 105;flags=visible;
button=15,20,ThumbNail3.pcx,ThumbNail3.pcx,ThumbNail3.pcx,
Null,Null,Null;',
_VAR(1));




www.LazyDogSoftware.com
Delphi SDK Homepage

A7 Pro 780
Delphi 5 through 2010
Re: Panel in C++: how to create / display? [Re: LazyDog] #190459
03/27/08 16:11
03/27/08 16:11
Joined: Oct 2002
Posts: 799
Germany->Bavaria->Nuremberg
C
Christian__A Offline
User
Christian__A  Offline
User
C

Joined: Oct 2002
Posts: 799
Germany->Bavaria->Nuremberg
try menu->flags |= _VAR(VISIBLE);


MfG, Christian__A. Visit my Site: www.chris-a.de


Re: Panel in C++: how to create / display? [Re: Christian__A] #190460
03/28/08 01:35
03/28/08 01:35
Joined: Feb 2008
Posts: 23
Sjlver Offline OP
Newbie
Sjlver  Offline OP
Newbie

Joined: Feb 2008
Posts: 23
Your guys are heroes... thanks a lot ;-)

It works with LazyDog's pan_create approach. However, for the flags, it seems that using _VAR() is wrong !?

Cheers,
Jonas

Last edited by Sjlver; 03/28/08 04:11.
Re: Panel in C++: how to create / display? [Re: Sjlver] #190461
03/28/08 07:15
03/28/08 07:15
Joined: Feb 2008
Posts: 23
Sjlver Offline OP
Newbie
Sjlver  Offline OP
Newbie

Joined: Feb 2008
Posts: 23
One more question:

what about buttons and sliders: Is there a way for a pure C++ app to use them?
- I don't see how I should pass a pointer to a function to them
- For sliders, I don't see how I could read the value

LazyDog, you seem to be using a button... if I tried this code, but it wouldn't display. Did you really get this work?

Thanks for all help
Jonas

Re: Panel in C++: how to create / display? [Re: Sjlver] #190462
03/28/08 12:36
03/28/08 12:36
Joined: Dec 2003
Posts: 521
LazyDog Offline
User
LazyDog  Offline
User

Joined: Dec 2003
Posts: 521
_VAR() is the delphi function I think for c++ it's just VAR(), Var is a reserved word in delphi so I had to dd a character.

yes you can use buttons and sliders in c++ and yes my code works perfectly in delphi.

here are some delphi examples, read the help file for info about
pan_create, pan_setevent so you can convert to c++

Code:

Var ThePos : Var_; // tracks value of our vslider

//create a vslider
//don't forget the ";" at the end of the command string !!!!
//we'll use pan_setver to use our variable ThePos for the value of the slider
Panel1 := pan_create('bmap = VScrollBox3.pcx;pos_x = 550;pos_y = 230;
vslider=1,1,230,ThumbNail3.pcx,1,100,0;',_VAR(1));

FlagOn(Panel1.flags,_VISIBLE or OVERLAY); // FlagOn is delphi fucntion
pan_setvar(Panel1,_VAR(4),_VAR(1.7),@ThePos);

// this example creates a button and assigns delphi functions to the events
Panel2 := pan_create('bmap = levelcode3.pcx;pos_x = 325;pos_y = 105;
flags=visible;button=15,20,
ThumbNail3.pcx,ThumbNail3.pcx,ThumbNail3.pcx,
Null,Null,Null;',_VAR(1));

FlagOn(panel2.flags,_VISIBLE or OVERLAY);
Panel2.event := @PanelClickEvent;
pan_setevent(Panel2,_VAR(3),_VAR(1),@ScrollBtnClicked);
pan_setevent(Panel2,_VAR(3),_VAR(1.1),@MouseLeaveEvent);
pan_setevent(Panel2,_VAR(3),_VAR(1.2),@MouseOverEvent);




www.LazyDogSoftware.com
Delphi SDK Homepage

A7 Pro 780
Delphi 5 through 2010
Re: Panel in C++: how to create / display? [Re: LazyDog] #190463
03/29/08 10:24
03/29/08 10:24
Joined: Feb 2008
Posts: 2
A
AhHong Offline
Guest
AhHong  Offline
Guest
A

Joined: Feb 2008
Posts: 2
pan_setevent is not documented in the 3D GameStudio Manual. Is is also not defined in the header files (.h) provided by the SDK.

I am using A6.

Re: Panel in C++: how to create / display? [Re: AhHong] #199822
04/01/08 13:07
04/01/08 13:07
Joined: Oct 2002
Posts: 799
Germany->Bavaria->Nuremberg
C
Christian__A Offline
User
Christian__A  Offline
User
C

Joined: Oct 2002
Posts: 799
Germany->Bavaria->Nuremberg
In my A7-headers pan_setevent is declared in afuncs.h ... Did u look within this file?

BTW. its also _VAR(x) for the conversation int/double to var in C++

Last edited by Christian__A; 04/01/08 13:08.

MfG, Christian__A. Visit my Site: www.chris-a.de


Re: Panel in C++: how to create / display? [Re: Christian__A] #200432
04/04/08 02:04
04/04/08 02:04
Joined: Feb 2008
Posts: 23
Sjlver Offline OP
Newbie
Sjlver  Offline OP
Newbie

Joined: Feb 2008
Posts: 23
Yes it seems pan_setevent and pan_setvar are addition in A7 that are not present in A6, so I believe with A6 there's simply no way to use those buttons. Anyway thanks for all your help! Finally we ended up coding those buttons by ourselves...

Thanks a lot to Lazydog and Christian for their help.

About the _VAR issue: it's with underscore in both Delphi and C++, but the crucial point is that it's wrong to use it for flags! Seems like flags are stored as values of type long and not var... anyway just write p->flags |= VISIBLE and it works.

Re: Panel in C++: how to create / display? [Re: LazyDog] #204254
04/28/08 08:53
04/28/08 08:53
Joined: Dec 2006
Posts: 434
UK,Terra, SolarSystem, Milky W...
pararealist Offline
Senior Member
pararealist  Offline
Senior Member

Joined: Dec 2006
Posts: 434
UK,Terra, SolarSystem, Milky W...
Quote: yes you can use buttons and sliders in c++ and yes my code works perfectly in delphi.

No problem after converting your code to c++
but have you (tried) used digits ?
Digits just dont show up on the panel, buttons, sliders etc does.


A8.3x Commercial, AcknexWrapper and VS 2010 Express
○pararealist now.
Page 1 of 3 1 2 3

Moderated by  TWO 

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