PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

CheckBox Button Control

Paul_Fielder · 04 Sep 2006, 15:12 UTC
Can Anyone Help!

I have been playing around with PPL for a couple of weeks and looking forward to the release of version 1.0 later this month.

I have come across a problem that I hope that someone could help me with, I’m using a checkbox on a form but I want to save the results from the checkbox form I need to be able to read it’s results once the form is closed, and then next time the form is shown reset the control.

I understand that I can set the value of an EditBox with SetText(Control, Value) and retrieve it with GetText(Control, Value) but can find no reference for CheckBoxes.

Any help or guidance will be greatly received.
PointOfLight · 05 Sep 2006, 02:38 UTC
To get the state of a checkbox:

Code:

result$ = SendMessage(nameofcheckbox$, BM_GETCHECK, 0, 0);


To set a checkbox:

Code:

if(checked$ == true)
value$ = BST_CHECKED;
else
value$ = BST_UNCHECKED;
end;
SendMessage(nameofcheckbox$, BM_SETCHECK, value$, 0);


The {if(checked$ == true)} would be whatever criteria you would use to validate whether or not the checkbox should be checked. the constants should be defined for you in one of the standard PPL include files. Hope this helps.
Paul_Fielder · 05 Sep 2006, 05:41 UTC — Many Thanks
Thanks for your help, I must of spent a whole day trying to sort out a routine that will only be called once in a blue moon; o how I love programming.

Seriously thanks for your help.
PointOfLight · 05 Sep 2006, 05:48 UTC
Glad I could help. Remember, though, even if you only you use that routine once in a while, you might use bits of code from it in other places.
Hi Paul,

Thanks for your interest in PPL.

If you need to save values to a file, I suggest you take a look at the inifiles.ppl library. It has some very handy functions that you can easily use in your programs to save and load information from a file.

Hope you like PPL, we are working very hard to make sure it is as easy as possible to use. We have great plans for the upcoming versions.

PPL is a product that will always evolve and get better!
Paul_Fielder · 06 Sep 2006, 00:24 UTC — inifiles.ppl
Kornalius,

I have already discovered the delights of the ini file routines; this is great advantage over EVB, no need to parse the file myself, although (and I appreciate still at Beta stage) I find the documentation / help causes a lot of time looking back and forward through the demos to find an example to shed the light as I’m still gaining knowledge all the time.

That said I really like the whole package, especially as I use and aging P2 laptop to do the bulk of my programming on so the small PC footprint / requirement with the ability to titivate on the Pocket PC a great boost.

When you release version 1.0 will the documentation be overhauled? Or is this still an area of work in progress?

Yours

Paul.
PointOfLight · 06 Sep 2006, 00:33 UTC
The documentation will be overhauled, but it is a work in progress. Once 1.0 is released I hope we will be able to have a few intermediate updates to the help file to fill in some of the gaps. The delay in the completed text is actually my doing, as I did not realize how big of an undertaking it was going to be. I assure you, though, that there will be skilled individuals on the boards to help you along the way until the documentation is complete. I hope Kornalius doesn't somehow strike me down for speaking out of turn, but I believe one of the main focuses of PPL is ease of use, and I understand as much as anybody that part of the requirement to accomplish that is a good help system.
Paul_Fielder · 06 Sep 2006, 01:49 UTC
So I gather from your post that you are well in on the development of PPL, is this a full-time occupation or a sideline? I must say that I wasn’t expecting such a speedy response to my original post the forum seems quite at the moment. I enjoy the changes that programming brings but it does dent you if you spend a whole day searching for what would normally be a very simple operation. As it transpires in PPl it is also very simple (when you know how) :)
PointOfLight · 06 Sep 2006, 01:54 UTC
I believe for Kornalius it is a full time gig. For me it's just a sideline right now. I must confess, however, that I probably spend as much time per week on my PDA "hobby" as I do on my full time job. As far as PPL the product is concerned, it is set to release on the 14th of this month. That's where the comment about the evolving help file comes in. It would have been nice to have a completely revamped manual for the launch, but unfortunately my multiple commitments prevented that from happening. It will certainly be in a much more presentable fashion than it is now, however.
Paul_Fielder · 06 Sep 2006, 02:45 UTC — PIDE Compile Window
Here is a quick one for you, how do you get the output window / pane back I closed it somehow now can't find how to get it back again, real pain if you have an error in your code because you can't see the line number with the link into the code.

Paul
PointOfLight · 06 Sep 2006, 03:34 UTC
Honestly, the quickest way I can think of is to recompile the program. Under the Windows menu there's an option to pull up the error log, but it doesn't actually display the last error you received. Kornalius, hopefully you can either point out something simple I'm missing, or maybe bringing up the last console output is something you could add.
Just hit Windows/Error Log, it will display the log again. If it doesn't work in your version, I know it does in the latest v1.0. The easiest way then is to hit F7 to recompile.
Paul_Fielder · 06 Sep 2006, 17:22 UTC — Radiobutton
Thanks for that I will give that a go later this evening when I get a few moments, so am I right in thinging that to get / set the value of a radio button I follow the same process as for the Checkbox.

result$ = SendMessage(nameofRadioButton$, BM_GETCHECK, 0, 0);


Yours Paul
PointOfLight · 06 Sep 2006, 17:35 UTC
I believe you are absolutely correct.
Yes you are right. Check the following it's your best friend really!

http://msdn.microsoft.com/library/defau ... tcheck.asp

The new PIDE offers a way to look on the MSDN for specific functions and values right from the editor. You will find that pretty usefull.

I was thinking about it a few minutes ago, I think the reason why you find PPL a little harder in the GUI design is because we don't use an object-oriented GUI components like most RAD tools on the market. We use the default Windows API, which is a little more complex to use. But when you get use to it, it's pretty easy you'll see.

However, it is something we are definitely planning for a later version (maybe 1.5 or 2.0). It is a huge project and will take too much time and too much re-design for v1.0. But don't worry it is in our plans.

It would be so much better to do:

Code:
CheckBox.Checked$ = True;


I know instead of:

Code:
SendMessage(CheckBox$, BM_SETCHECK, True, 0);


It's all there, the OO syntax is ready for something like that but the time it will take to do all the components is not something I can do right now.
PointOfLight · 06 Sep 2006, 19:37 UTC
There are functions to ease the pain a little bit, however. If you look in the \PPL\LIB directory under the install directory, there are several files called XXXX_lib.ppl, where XXXX is the name of some control. These are libraries of routines that use more common style names (ex: ComboBox_AddItem), then handle the SendMessage command structure for you. Like many other things, that functionality I'm planning on documenting as soon as I get the chance.
You know what guys, after thinking about it even more I came to the conclusion that a Simplyfied Windows API set of functions was more than needed.

Just like PointOfLight was mentionning, I will take all the functions from the xxxxxxx_lib.ppl libraries and regroup them into one easy set of functions under the name : swapi.ppl

I will try to simplify things even more if I can. This way maybe a SetCheck(CheckBox$, True); will be easier and ListAdd(Combo$, "Item"); to work on lists and comboboxes too maybe.

I'll give you guys an update tomorrow on the status of this new api.

In the meantime if you guys have any cool ideas, it's time to say something. Version 1.0 is coming and I want it to be the best!