[Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 215
  • Last Modified:

Button without a frame

Hello,

how can I create button without a frame, or set appropriate style to it? I found ButtonFrameType enum, that is set of values for 'frame' field of the ControlAttrType structure, but there is no API to set the style !!

Any help / advise ?

thank you,

Alexey
0
tulin
Asked:
tulin
  • 2
  • 2
  • 2
1 Solution
 
offir_aCommented:
Hi Alexey,
Are you using the Constructor to create your forms?
If so, open a form with a button on it. Click the button and on the layout properties you'll see the checkbox named "Frame". Clear it - and you'll have a frameless button.

Hope this helps,
Offir.
0
 
tulinAuthor Commented:
No, I create the button dynamically using CtlNewControl() API
0
 
offir_aCommented:
Hi,

I've checked the reference for it, and then checked the web as well... this seems like a strange bug in PalmOS!
They write in the reference "The ButtonFrameType specifies the type of box.", but they don't write how to send it into CtlNewControl() !!!

Another guy asked for the same thing in another group several months ago, and got the same "HUH!?" answer...

Well, in this case, if you don't want to waste time, I would go on the easy solution: Create as many buttons as you'll need dynamically - as static buttons on the form, but all are hidden, and only show those you need at run time. a lame solution, but should work...
Another way to bypass it is to create your own button as a gadget, or just to catch the pen down events and check if it's in the place you should have a button...

Sorry... :) Hope this helps in any way!
Offir.
0
How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

 
waseemanisCommented:
I use the following code to do that:


ControlPtr ctl = CtlNewControl( (void**)&frmP, 2002, buttonCtl , "Test", 10, 25, 36,12, stdFont, 0, true );

ctl -> attr.frame = noButtonFrame;

CtlDrawControl(ctl);



Hope this works for you.
Waseem.
0
 
tulinAuthor Commented:
I did so also, but there is a caution in the Palm documentation - not to access the structure directly, because in the future versions it may change. I asked how can I do this using API.
0
 
waseemanisCommented:
Well .. from what it seems.. this is one chance you'd have to take...I would !!
0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

  • 2
  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now