Page 1 of 1

PostPosted: Thu Jul 20, 2006 6:16 pm
by squib308
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;

puts("\nmathupd..."); //debug
puts("\nv,F,W: " + v+" "+F+" "+W); //debug

int e,done;

//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"); //"

Label(5022,100,125,"watts power");
exitbuttons(); //from skelform.c installs exit buttons
while(!done) {
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

PostPosted: Fri Jul 21, 2006 12:30 am
by jstadolnik
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).


The PToolboxLib guy.

PostPosted: Fri Jul 21, 2006 6:28 am
by squib308
> 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!

PostPosted: Fri Jul 21, 2006 11:25 am
by jstadolnik
Make sure that you are using the latest public version of the library.

It may remedy the frame problem.


The PToolboxLib guy.

PostPosted: Wed Aug 02, 2006 9:12 pm
by squib308
>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!

PostPosted: Wed Aug 02, 2006 11:48 pm
by jstadolnik
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.


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

The PToolboxLib guy.