I've uploaded my enhanced pushbutton code to the source code forum. This code is already in use in my major application so should be relatively stable (famous last words). Any suggestions for improvement or extension gratefully received!
Announcement
Collapse
No announcement yet.
ButtonPlus in Source Code
Collapse
X
-
Thanks for your comments Scott, both here and in the Source Code forum. Thanks for looking so closely. That's partly the reason for posting - to get another pair of eyes on it, spotting things that I've missed.
Of course you're right on both counts and I've updated the posted code and files to include these changes.
Immediately I posted originally I saw another thing also. In the focus tracking code there was a lot of duplicated code in the dialog activation and de-activation sections which has now been consolidated. It was my intention to re-use vacant array slots for dialogs which had been destroyed, but I neglected to mark the array elements as unused. This may be significant for memory use if used in an application which creates and destroys a lot of dialogs. The update also includes these changes.- LJ
Comment
-
-
Originally posted by Laurence Jackson View PostAny suggestions for improvement or extension gratefully received!
The screenshots look fabulous.
======================================
“Lord, grant that my work
increase knowledge and help other men.
“Failing that, Lord, grant that
it will not lead to man’s destruction.
“Failing that, Lord, grant that
my article be published
before the destruction takes place.”
Scientist's Prayer
======================================Last edited by Gösta H. Lovgren-2; 24 Oct 2008, 09:50 PM.It's a pretty day. I hope you enjoy it.
Gösta
My Ego Site: http://www.SwedesDock.comPB Newby Tips: http://www.swedesdock.com/powerbasic/pb_shortcuts.htmlJWAM: (Quit Smoking): http://www.SwedesDock.com/smokingLDN - A Miracle Drug: http://www.SwedesDock.com/LDN/
Comment
-
-
Originally posted by Gösta H. Lovgren-2 View PostSure, a link to the code.- LJ
Comment
-
-
What he meant was that to help us go directly to your post in the source code, post a link to that topic here, like this:
This is because the source code forum keeps growing, so rather than have interested PB's have to look through many pages of the forum or do an on-line search ... please add the link in the discussing thread when you start it. Most will appreciate that!Rick Angell
Comment
-
-
Originally posted by Laurence Jackson View PostI'm not sure what you mean, all the source code, resources, compiled executables and documentation are in the attached zip.
I tried compiling "ButtonPlusDemo.RC" to get a .pbr but get"Error occurred creating Resource (RES) file." Here's the codeCode:#include "Resource.h" VS_VERSION_INFO VERSIONINFO FILEVERSION 1, 0, 0, 0 PRODUCTVERSION 1, 0, 0, 0 FILEOS VOS_WINDOWS32 FILETYPE VFT_APP BEGIN BLOCK "StringFileInfo" BEGIN BLOCK "040904B0" BEGIN VALUE "CompanyName", "Laurence Jackson\000" VALUE "FileDescription", "ButtonPlus Demo\000" VALUE "FileVersion", "01.00.0000\000" VALUE "InternalName", "BUTTONPLUS\000" VALUE "OriginalFilename", "BUTTONPLUS.EXE\000" VALUE "LegalCopyright", "Public domain\000" VALUE "ProductName", "\000" VALUE "ProductVersion", "\000" VALUE "Comments", "\000" END END BLOCK "VarFileInfo" BEGIN VALUE "Translation", 0x409, 0x4B0 END END #define IDR_HICON 200 IDR_HICON ICON DISCARDABLE "HI.ICO" #define CREATEPROCESS_MANIFEST_RESOURCE_ID 1 #define RT_MANIFEST 24 CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "xptheme.xml"
She knows what is the best purpose of education:
not to be frightened by the best
but to treat it as part of daily life.
John Mason Brown
=================================================It's a pretty day. I hope you enjoy it.
Gösta
My Ego Site: http://www.SwedesDock.comPB Newby Tips: http://www.swedesdock.com/powerbasic/pb_shortcuts.htmlJWAM: (Quit Smoking): http://www.SwedesDock.com/smokingLDN - A Miracle Drug: http://www.SwedesDock.com/LDN/
Comment
-
-
Check the ".rclog" file created by RC.EXE.
I've had problems getting error messages from RC.EXE back from the PB IDE resource compile. This file has the error message (if any) from RC.EXE.
(Seems with IDE compile, PBRES just runs anyway even when rc.exe returns an error. Kind of strange.. about the only good thing is it makes you pay attention during the resource compile.)
MCMMichael Mattias
Tal Systems (retired)
Port Washington WI USA
[email protected]
http://www.talsystems.com
Comment
-
-
Originally posted by Michael Mattias View PostCheck the ".rclog" file created by RC.EXE.
MCM
=====================================================
"#3 pencils and quadrille pads."
Seymoure Cray (1925-1996)
when asked what CAD tools
he used to design the Cray I supercomputer;
he also recommended using the back side of the pages
so that the grid lines were not so dominant.
=====================================================It's a pretty day. I hope you enjoy it.
Gösta
My Ego Site: http://www.SwedesDock.comPB Newby Tips: http://www.swedesdock.com/powerbasic/pb_shortcuts.htmlJWAM: (Quit Smoking): http://www.SwedesDock.com/smokingLDN - A Miracle Drug: http://www.SwedesDock.com/LDN/
Comment
-
-
Then just try a straight command-line resource compile and see what you can on the screen.
Code:C:\DOS> rc.exe sourcefilename[.rc]
Michael Mattias
Tal Systems (retired)
Port Washington WI USA
[email protected]
http://www.talsystems.com
Comment
-
-
Originally posted by Michael Mattias View PostThen just try a straight command-line resource compile and see what you can on the screen.
Code:C:\DOS> rc.exe sourcefilename[.rc]
===========================================
"We don't need lists of rights and wrongs,
tables of do's and don'ts:
we need books, time, and silence.
'Thou shalt not'
is soon forgotten,
but 'Once upon a time'
lasts forever."
Philip Pullman (1946-)
===========================================It's a pretty day. I hope you enjoy it.
Gösta
My Ego Site: http://www.SwedesDock.comPB Newby Tips: http://www.swedesdock.com/powerbasic/pb_shortcuts.htmlJWAM: (Quit Smoking): http://www.SwedesDock.com/smokingLDN - A Miracle Drug: http://www.SwedesDock.com/LDN/
Comment
-
-
At first I thought that it might be to do with me using a newer resource compiler than that supplied with PB9, but I've just tried it with the old RC and it still works fine for me, so I'm stumped. Are both "hi.ico" and "xptheme.xml" in the directory with "ButtonPlusDemo.rc"?
It's clear I'm doing something wrong here. I expected that when I compiled "BPD.rc" it would create "BPD.pbr". Obviously I'm wrong.
Originally posted by Laurence Jackson View PostOK Gösta, here's a PBR hot from the compiler that works for me
=================================
"Too many pieces of music finish
too long after the end."
Igor Stravinsky (1882-1971)
=================================It's a pretty day. I hope you enjoy it.
Gösta
My Ego Site: http://www.SwedesDock.comPB Newby Tips: http://www.swedesdock.com/powerbasic/pb_shortcuts.htmlJWAM: (Quit Smoking): http://www.SwedesDock.com/smokingLDN - A Miracle Drug: http://www.SwedesDock.com/LDN/
Comment
-
-
Originally posted by Laurence Jackson View PostGösta: There wasn't intended to be a PBR in the ZIP. You should have been able to make it from the RC and other files. I still don't understand why you couldn't. Anyone else have problems?
Each time it created a 2k file beginning with "RC" and 3 hex vals and no extension.
I've checked the settings file in JFP and they are set correctly... so I tried PB8, ... same thing.
While writing this I got to thinking maybe it wasn't finding the "Resource.h" include. And sure enough, Resource.h is stored in the \WinApi\ and the compiler was looking in \bin\, so my setting was incorrect after all.
Everything hunky dory now.
Eddy: We all need kind words now and then - thanks!
=============================================
"I contend that we are both atheists.
I just believe in one fewer god than you do.
When you understand why
you dismiss all the other possible gods,
you will understand why I dismiss yours."
Sir Stephen Henry Roberts (1901-1971)
=============================================It's a pretty day. I hope you enjoy it.
Gösta
My Ego Site: http://www.SwedesDock.comPB Newby Tips: http://www.swedesdock.com/powerbasic/pb_shortcuts.htmlJWAM: (Quit Smoking): http://www.SwedesDock.com/smokingLDN - A Miracle Drug: http://www.SwedesDock.com/LDN/
Comment
-
-
While writing this I got to thinking maybe it wasn't finding the "Resource.h" include. And sure enough, Resource.h is stored in the \WinApi\ and the compiler was looking in \bin\, so my setting was incorrect after all.
Just one word of warning: those error messages are cryptic at best. (Frankly they stink). However, when you get "undefined symbol" it can mean missing #include or you did not match the CASE of the token between the #define and its use.
You can also get "newline unexpected." This usually means either a mismatch in BEGIN/END statments OR.... mismatched quotes (this one gets me all the time).
Mismatched quotes can give you all kinds of strange errors so that's always a good thing to look for when the error message itself is less than helpful.
MCMMichael Mattias
Tal Systems (retired)
Port Washington WI USA
[email protected]
http://www.talsystems.com
Comment
-
-
Originally posted by Michael Mattias View PostI'm glad you found the problem. That said, either that ".rclog" file or one of the "Ra12324" files should have error messages from the failed resource compile.
Back to subject at hand (Laurence's neat (and hopefully ging to be useful to me) code. In in effort to get a better grasp of the demo code I just spent some time changing variable names and moving the buttons into Macros. Looks like it is going to be a worthwhile time investment for me as I think now I'm seeing better how it works. It's attached for any who are interested.
==============================
"Everybody pities the weak;
jealousy you have to earn."
Arnold Schwarzenegger (1947-)
==============================Attached FilesIt's a pretty day. I hope you enjoy it.
Gösta
My Ego Site: http://www.SwedesDock.comPB Newby Tips: http://www.swedesdock.com/powerbasic/pb_shortcuts.htmlJWAM: (Quit Smoking): http://www.SwedesDock.com/smokingLDN - A Miracle Drug: http://www.SwedesDock.com/LDN/
Comment
-
-
May be useful, may be not so useful....
Code:D:\Software_Development\pbwin90\bin>rc.exe /? Microsoft (R) Windows 32 Resource Compiler, Version 4.00 - Build 1367 Usage: rc [options] .RC input file Switches: /r Emit .RES file (optional) /v Verbose (print progress messages) /d Define a symbol /u Undefine a symbol /fo Rename .RES file /l Default language ID in hex /i Add a path for INCLUDE searches /x Ignore INCLUDE environment variable /c Define a code page used by NLS conversion Flags may be either upper or lower case D:\Software_Development\pbwin90\bin>
Michael Mattias
Tal Systems (retired)
Port Washington WI USA
[email protected]
http://www.talsystems.com
Comment
-
Comment