|
2 registered members (DrissB, clint000),
5,237
guests, and 2
spiders. |
|
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: Panel in C++: how to create / display?
[Re: pararealist]
#204383
04/29/08 00:06
04/29/08 00:06
|
Joined: Dec 2003
Posts: 521
LazyDog
User
|
User
Joined: Dec 2003
Posts: 521
|
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.
why yes I have tried digits and they work in Delphi. what this sample does it put 2 digits on a panel, the 1st digit simply is a label "y POS". the 2nd digit is the actual value for "y POS". I needed to use a place holder (time_fac) to actually generate the panel and then replace it with the actual variable I wanted which in this case is actually the y position of the panel.
Panel2 := pan_create('bmap = targ1.pcx;pos_x = 150;pos_y = 70;
flags=visible;
digits=10,50,"y POS",*,0,null;
digits=50,50,4,*,16,time_fac;',_VAR(2));
// this will replace the digit in our create string with our variable
// defined in our Delphi program
digits_set(Panel2,_VAR(2),@Panel2.pos_y);
|
|
|
Re: Panel in C++: how to create / display?
[Re: LazyDog]
#204480
04/29/08 15:11
04/29/08 15:11
|
Joined: Dec 2006
Posts: 434 UK,Terra, SolarSystem, Milky W...
pararealist
Senior Member
|
Senior Member
Joined: Dec 2006
Posts: 434
UK,Terra, SolarSystem, Milky W...
|
This is what i am trying
// Load debug screen
FONT* debugFont = font_create("dungeon#13biu");
PANEL* pDebug = pan_create(
"pos_x = 0; pos_y = 365;"
"digits = 10,0,DEBUG: gsANIMATE - using Gamestudio > A%0.4f\n,debugFont,1,ev->version;"
//
"digits = 10,35, iMLBtnPressed %0.0f\n ,debugFont,1,iMLBtnPressed);"
"digits = 10,50, iMMBtnPressed %0.0f\n ,debugFont,1,iMMBtnPressed);"
"digits = 10,65, iMRBtnPressed %0.0f\n ,debugFont,1,iMRBtnPressed);"
// test button
"button=3,3,opttabon1.pcx,opttab1.pcx,opttabov1.pcx, Null,Null,Null;"
//
"flags |= VISIBLE;"
,_VAR(1) );
the test button appears but nothing else. will try "*" instead of my defined FONT
A8.3x Commercial, AcknexWrapper and VS 2010 Express ○pararealist now.
|
|
|
Re: Panel in C++: how to create / display?
[Re: LazyDog]
#204612
04/30/08 07:46
04/30/08 07:46
|
Joined: Dec 2006
Posts: 434 UK,Terra, SolarSystem, Milky W...
pararealist
Senior Member
|
Senior Member
Joined: Dec 2006
Posts: 434
UK,Terra, SolarSystem, Milky W...
|
ib c++ its the only way to have it on separate lines (for readability). EDIT: when i break the lines without having each line in separate quotes i get errors in compiler. (this nearly made me pull my hair out, (what little i have left) until i found a solution googling.
Tried it on one long line too, still the same. test button diaplays ok, but digits dont(at least not yet)
This is beginning to be fun in Visual Studio C++ 2005. I find one must search and try (with help) until one gets it working.
I am actually doing the same project twice 1: rendering into a windows window and 2: just using acknex window with panels. // learning lots by doing it this way, And i dont get bored with the same problems.
Will continue trying.
Thanks a lot for reply and your help.
Last edited by pararealist; 04/30/08 07:52.
A8.3x Commercial, AcknexWrapper and VS 2010 Express ○pararealist now.
|
|
|
Re: Panel in C++: how to create / display?
[Re: pararealist]
#209752
06/05/08 13:56
06/05/08 13:56
|
Joined: Mar 2006
Posts: 15 Kansas, USA
quantum69
Newbie
|
Newbie
Joined: Mar 2006
Posts: 15
Kansas, USA
|
If you're still working on this, the way to have one long string broken across lines is using the backslash as the line-continuation character
FONT* sfonta = font_create("Arial#14");
PANEL* pSplash = pan_create("bmap = blitz.pcx; \
pos_x = 10; \
pos_y = 210; \
digits(10,40,\"chub chub\",*,0,0); \
digits(10,80,\"lost line\",sfonta,0,0); \
",_VAR(1));
As long as the cr/lf (the ENTER key) is pressed right AFTER the backslash, VS will interpret it as continuing the string on the next line. Any space after the backslash will gank it. My problem with panels and the digits is that it won't display even fixed text (as in this example) if I don't use the default * (acknex) font. I know the definition is precisely what I see in the docs and what I've seen in these threads, but as soon as I try to use my own font, the text doesn't show up. Any ideas? Be good or be good at it, failing that, run like hell! Quantum ps Don't forget to escape your embedded quotes ex. \"
Last edited by quantum69; 06/05/08 14:03.
------------------------------------ Quantum Mechanic Better living at the subatomic level
|
|
|
Re: Panel in C++: how to create / display?
[Re: quantum69]
#209996
06/07/08 07:20
06/07/08 07:20
|
Joined: Dec 2006
Posts: 434 UK,Terra, SolarSystem, Milky W...
pararealist
Senior Member
|
Senior Member
Joined: Dec 2006
Posts: 434
UK,Terra, SolarSystem, Milky W...
|
I have come to the conclusion that using panels in C++ is a terrible idea (at least for me).
My app is in Lite-C, but i am also doing it in C++ to learn C++ and classes. At the moment i am trying WIN32++ with A7. So far so Good. //
A8.3x Commercial, AcknexWrapper and VS 2010 Express ○pararealist now.
|
|
|
|