Solved

Button without a frame

Posted on 2002-07-22
9
209 Views
Last Modified: 2013-12-27
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
Comment
Question by:tulin
  • 2
  • 2
  • 2
9 Comments
 
LVL 4

Expert Comment

by:offir_a
ID: 7169574
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
 
LVL 1

Author Comment

by:tulin
ID: 7169649
No, I create the button dynamically using CtlNewControl() API
0
 
LVL 4

Accepted Solution

by:
offir_a earned 150 total points
ID: 7170676
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
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 
LVL 2

Expert Comment

by:waseemanis
ID: 7202473
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
 
LVL 1

Author Comment

by:tulin
ID: 7202725
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
 
LVL 2

Expert Comment

by:waseemanis
ID: 7202906
Well .. from what it seems.. this is one chance you'd have to take...I would !!
0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article shows how to setup the internet connectivity on Windows Mobile Emulator.   I assume that you already have Microsoft Visual Studio, Microsoft Windows Mobile SDK's and the emulator installed. The emulator is available with Visual Studi…
A short article about problems I had with the new location API and permissions in Marshmallow
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

791 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question