Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 112

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 112

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 112

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 112

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 112

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 112
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3368: Cannot modify header information - headers already sent by (output started at /includes/bbcode.php:472)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3370: Cannot modify header information - headers already sent by (output started at /includes/bbcode.php:472)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3371: Cannot modify header information - headers already sent by (output started at /includes/bbcode.php:472)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3372: Cannot modify header information - headers already sent by (output started at /includes/bbcode.php:472)
OrbWorks Community Forum • View topic - GButton with no frame vs Button w/o frame

GButton with no frame vs Button w/o frame

A PocketC native palm library offering native forms and assorted utilities

Postby squib308 on Thu Jul 20, 2006 6:16 pm

I'm trying to use GButtons with no frames, so you just see the bitmap & not the frame... When I do that, I can click the GButton, but it doesn't seem to have any effect. If I replace the same GButton function with Button with no frame - everything identical (except the parameters for the bitmap, selected bitmap, and text, depending on which of the two functions I'm trying). The Button without a frame works just fine, does what its supposed to, but GButton continues to not work.

Any hints why, or what I can do to make it work?

Here's my code:
//gbutton test

library "PToolboxLib"
include "Fctl.h"
include "skelform.c" //has a function to make exit buttons

int W,F,v;

mathupd(){
puts("\nmathupd..."); //debug
puts("\nv,F,W: " + v+" "+F+" "+W); //debug
W=0.5*F*v*v;
FsetText(5011,F);
FsetText(5010,v);
FsetText(5000,W);
}

main(){
int e,done;
OpenRsrcDb("MiscRes");
Form(3001,"duh");

//GButton(4060,0x40,40,40,20,20,6003,6004); //attemping no frame
//GButton(4061,0x40,40,60,20,20,6001,6002); //"
Button(4061,0x40,40,40,20,20,"up"); //"
Button(4060,0x40,40,60,20,20,"down"); //"

Field(5010,0,40,80,15,0,6,v);
Label(5020,40,95,"volts");
GButton(4062,0,80,40,20,20,6003,6004);
GButton(4063,0,80,60,20,20,6001,6002);
Field(5011,0,80,80,15,0,6,F);
Label(5021,80,95,"Farads");
Field(5000,0,100,110,25,0,8,W);
Label(5022,100,125,"watts power");
exitbuttons(); //from skelform.c installs exit buttons
Fctl(DRAW,3001);
while(!done) {
e=Fevent(1);
switch(e) {
case 4060: {--v;mathupd();break;}
case 4061: {++v;mathupd();break;}
case 4062: {--F;mathupd();break;}
case 4063: {++F;mathupd();break;}
case 7999: done=1; Fctl(FREE,-1);
case 7998: done=1; Fctl(FREE,-1);
}
}
puts("\nv,F,W: " + v+" "+F+" "+W); //debug
}
squib308
 
Posts: 4
Joined: Thu Jul 20, 2006 6:03 pm

Postby jstadolnik on Fri Jul 21, 2006 12:30 am

First I'd verify that your "MiscRes" database contains bitmaps with resource ids 6001 through 6004. If these bitmaps can't be found than the GButton likely won't work right.

Also, you have a mode of 0x40 for "no frame", you really want 0x30 which is also (3<<4 or rather 3 shifted 4 bits to the left).

-Joe

The PToolboxLib guy.
http://www.geocities.com/retro_01775/PToolboxLib.htm
jstadolnik
 
Posts: 1741
Joined: Wed Dec 06, 2000 3:34 am
Location: USA

Postby squib308 on Fri Jul 21, 2006 6:28 am

> First I'd verify that your "MiscRes" database
Yep, everything's cool there - my bitmaps show up.

>Also, you have a mode of 0x40 for "no frame", you really want 0x30
Yeah. that. I grabbed the code I had on the palm desktop's memo, which had that in it when I was testing things. I changed it to 0x30 a bit back, (no pun intended) but haven't hotsync'ed.. thus you're seeing my experiment with 0x40. It's changed now. :)

It works like it should with any of the frame modes, except no frame. I'm trying it on PalmOS 5.2.1, PocketC ver 7.0.0, PToolbox 7.6.1 and I tried Ptoolbox 7.6.2beta9 (how did i find that link, anyway?), both with the same result. I haven't tried pocketc desktop / simulator. Uhm.. I'm still ugly, but changing that is a little difficult. my bitmaps are 8 bit. As you can see in the code, I'm not in hires mode or anything. My bitmaps are 20x20, same as I specified in the GButton func. I did try putting 30x30 in the Gbutton func (for width/height), and if I had the frame on, it made the frame bigger, but didn't make any difference for the no frame attempts. Since I've got a et of GButtons I sometimes try different things on different buttons :)

But alas, no joy. It ONLY happens when I have no frame set, any other frame works fine. I stuck a puts function in the case: for the frameless GButtons, and I never get any output from those, either; whereas if I leave the other buttons with frames, they do give me output.

Thanks for any input!
squib308
 
Posts: 4
Joined: Thu Jul 20, 2006 6:03 pm

Postby jstadolnik on Fri Jul 21, 2006 11:25 am

Make sure that you are using the latest public version of the library.

http://pocketc.net/forum/topic.asp?TOPIC_ID=3183

It may remedy the frame problem.

-Joe

The PToolboxLib guy.
http://www.geocities.com/retro_01775/PToolboxLib.htm
jstadolnik
 
Posts: 1741
Joined: Wed Dec 06, 2000 3:34 am
Location: USA

Postby squib308 on Wed Aug 02, 2006 9:12 pm

>Make sure that you are using the latest public version of the library.
>It may remedy the frame problem.

Yeah, no good - I tried 7.6.2beta9, 7.6.1, 7.5.3...

I think I figured it out (as I was reading docs for prolly the thousandth time) - although GButton doesnt say so directly, in the Button docs there is a table of bits/button types, and bits/frame types, and it says over there "
Frame Style (for Standard and Repeat Buttons).

Note: Palm OS5.0 will only support the standard frame style for standard buttons and the no frame style for repeat buttons
"

... only standard frams for standard buttons.. no frame for repeat buttons.. no frame for repeat buttons.. OHHH.. .??

So, if I go ahead and tackle dealing with repeat buttons & handling that stuff, instead of putting it off till later, it will let me have my no frame buttons work. maybe?

I tried a Button (not GButton) with little text arrows ^ & v and no frame, and it gave me the same problem. So yes, GButton is no different than Button in that respect. Why the limitation on OS5.x that makes you make it a repeat button in order to get no frame makes no sense to me, but I'll play the cards I'm delt so...

I attacked the whole FCTL REPEAT thing & set up a handler func, (haven't attacked EHAND yet) and got it to do what I want - display GButton with no frame. Hooray!!

..except of course now I see that GButton doesn't support transparency, so my diddling around to make some basic buttons & code to re-use later is kind of a bust, because I wanted to be able to stick 'em in whatever project came up & be able to stick them over other bmps without the white space frame around them. Doh!

Oh well, at least I learned how I'm going to deal with someone holding the button down. :) Maybe I'll work on how fast the numbers accelerate or something vs time button held down, to make it easier to get to high numbers without waiting forever, or something.

Thanks again for your input & work on PToolbox!

PS. lemme know if you ever support transparency in GButton, I'll be excited!
squib308
 
Posts: 4
Joined: Thu Jul 20, 2006 6:03 pm

Postby jstadolnik on Wed Aug 02, 2006 11:48 pm

The palmOS doesn't provide any way of changing the frame on dynamically added graphical buttons. You'll have to either use resource forms or switch to PocketC Architect.

-Joe

BTW: I haven't updated the PToolboxLib in about 2 years and have no plans of doing so in the future.


The PToolboxLib guy.
http://www.geocities.com/retro_01775/PToolboxLib.htm
jstadolnik
 
Posts: 1741
Joined: Wed Dec 06, 2000 3:34 am
Location: USA


Return to Pocket Toolbox

Who is online

Users browsing this forum: No registered users and 2 guests

cron