PowerBASIC Peer Support Forums
 

Go Back   PowerBASIC Peer Support Forums > User to user Discussions > PowerBASIC for Windows

Notices

PowerBASIC for Windows User to user discussions about the PB/Win (formerly PB/DLL) product line. Discussion topics include PowerBASIC Forms, PowerGEN and PowerTree for Windows.

Reply
 
Thread Tools Display Modes
  #1  
Old Oct 21st, 2008, 08:12 PM
Laurence Jackson Laurence Jackson is offline
Member
 
Join Date: Feb 2006
Location: Brazil
Posts: 228
ButtonPlus in Source Code

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!
__________________
- LJ
Reply With Quote
  #2  
Old Oct 22nd, 2008, 05:50 PM
Scott Slater Scott Slater is offline
Member
 
Join Date: Aug 1999
Posts: 727
Thanks, this is a very nice addition. I can see that it will be very helpful in future projects!
__________________
Scott Slater
Summit Computer Networks, Inc.
www.summitcn.com
Reply With Quote
  #3  
Old Oct 24th, 2008, 07:30 PM
Laurence Jackson Laurence Jackson is offline
Member
 
Join Date: Feb 2006
Location: Brazil
Posts: 228
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
Reply With Quote
  #4  
Old Oct 24th, 2008, 10:45 PM
Gösta H. Lovgren-2 Gösta H. Lovgren-2 is offline
Member
 
Join Date: Sep 2002
Location: New Jersey Shore
Posts: 2,517
Quote:
Originally Posted by Laurence Jackson View Post
Any suggestions for improvement or extension gratefully received!
Sure, a link to the code.

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
======================================
__________________
It's a pretty day. I hope you enjoy it.

Gösta
Easy Tape (It All Adds UP): http://www.swedesdock.com/easytape
My Ego Site: http://www.SwedesDock.com
PB Newby Tips: http://www.swedesdock.com/powerbasic/pb_shortcuts.html
JWAM: (Quit Smoking): http://www.SwedesDock.com/smoking
Free PB Programs: http://www.swedesdock.com/powerbasic/Programs.shtml

Last edited by Gösta H. Lovgren-2; Oct 24th, 2008 at 10:50 PM.
Reply With Quote
  #5  
Old Oct 25th, 2008, 08:47 AM
Laurence Jackson Laurence Jackson is offline
Member
 
Join Date: Feb 2006
Location: Brazil
Posts: 228
Quote:
Originally Posted by Gösta H. Lovgren-2 View Post
Sure, a link to the code.
I'm not sure what you mean, all the source code, resources, compiled executables and documentation are in the attached zip.
__________________
- LJ
Reply With Quote
  #6  
Old Oct 25th, 2008, 09:39 AM
Richard Angell Richard Angell is offline
Member
 
Join Date: May 1994
Posts: 2,909
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:

http://www.powerbasic.com/support/pb...ad.php?t=38903

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
Reply With Quote
  #7  
Old May 25th, 2009, 12:44 PM
Gösta H. Lovgren-2 Gösta H. Lovgren-2 is offline
Member
 
Join Date: Sep 2002
Location: New Jersey Shore
Posts: 2,517
Quote:
Originally Posted by Laurence Jackson View Post
I'm not sure what you mean, all the source code, resources, compiled executables and documentation are in the attached zip.
Laurence, for whatever reason I just now got around to playing/looking at your Buttons. And they look neat. (I've long wanted to have colored buttons.) The .exe's run fine, however when I try to run ButtonPlusDemo.bas, there's a Msgbox "Go To Line" and then a compiler error "No resource file".

I tried compiling "ButtonPlusDemo.RC" to get a .pbr but get"Error occurred creating Resource (RES) file." Here's the code
Code:
#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
Easy Tape (It All Adds UP): http://www.swedesdock.com/easytape
My Ego Site: http://www.SwedesDock.com
PB Newby Tips: http://www.swedesdock.com/powerbasic/pb_shortcuts.html
JWAM: (Quit Smoking): http://www.SwedesDock.com/smoking
Free PB Programs: http://www.swedesdock.com/powerbasic/Programs.shtml
Reply With Quote
  #8  
Old May 25th, 2009, 12:53 PM
Michael Mattias Michael Mattias is offline
Member
 
Join Date: Aug 1998
Location: Racine WI USA
Posts: 26,189
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.)

MCM
Reply With Quote
  #9  
Old May 25th, 2009, 01:08 PM
Gösta H. Lovgren-2 Gösta H. Lovgren-2 is offline
Member
 
Join Date: Sep 2002
Location: New Jersey Shore
Posts: 2,517
Quote:
Originally Posted by Michael Mattias View Post
Check the ".rclog" file created by RC.EXE.

MCM
No .rclog's created anywhere I can find. Several in the PB9 folders but none related ButtonPlus. Not in the resident folder either.

================================================== ===
"#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
Easy Tape (It All Adds UP): http://www.swedesdock.com/easytape
My Ego Site: http://www.SwedesDock.com
PB Newby Tips: http://www.swedesdock.com/powerbasic/pb_shortcuts.html
JWAM: (Quit Smoking): http://www.SwedesDock.com/smoking
Free PB Programs: http://www.swedesdock.com/powerbasic/Programs.shtml
Reply With Quote
  #10  
Old May 25th, 2009, 01:20 PM
Michael Mattias Michael Mattias is offline
Member
 
Join Date: Aug 1998
Location: Racine WI USA
Posts: 26,189
Then just try a straight command-line resource compile and see what you can on the screen.

Code:
C:\DOS> rc.exe  sourcefilename[.rc]
Reply With Quote
  #11  
Old May 25th, 2009, 01:50 PM
Laurence Jackson Laurence Jackson is offline
Member
 
Join Date: Feb 2006
Location: Brazil
Posts: 228
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"?
__________________
- LJ
Reply With Quote
  #12  
Old May 25th, 2009, 01:52 PM
Gösta H. Lovgren-2 Gösta H. Lovgren-2 is offline
Member
 
Join Date: Sep 2002
Location: New Jersey Shore
Posts: 2,517
Quote:
Originally Posted by Michael Mattias View Post
Then just try a straight command-line resource compile and see what you can on the screen.

Code:
C:\DOS> rc.exe  sourcefilename[.rc]
Nothing happened either. Think I'll just wait for Laurence to post a valid pbr. Thanks anyway.

===========================================
"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
Easy Tape (It All Adds UP): http://www.swedesdock.com/easytape
My Ego Site: http://www.SwedesDock.com
PB Newby Tips: http://www.swedesdock.com/powerbasic/pb_shortcuts.html
JWAM: (Quit Smoking): http://www.SwedesDock.com/smoking
Free PB Programs: http://www.swedesdock.com/powerbasic/Programs.shtml
Reply With Quote
  #13  
Old May 25th, 2009, 02:25 PM
Laurence Jackson Laurence Jackson is offline
Member
 
Join Date: Feb 2006
Location: Brazil
Posts: 228
OK Gösta, here's a PBR hot from the compiler that works for me
Attached Files
File Type: pbr BUTTONPLUSDEMO.pbr (28.1 KB, 40 views)
__________________
- LJ
Reply With Quote
  #14  
Old May 25th, 2009, 09:24 PM
Gösta H. Lovgren-2 Gösta H. Lovgren-2 is offline
Member
 
Join Date: Sep 2002
Location: New Jersey Shore
Posts: 2,517
Quote:
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"?
Both files are in the same folder. When looking I saw that 4 or 5 new files created today at about the same time as I was trying to compile the bpd.rc. They are named "RCa01512" through "RCa03824" (no extensions) which presumably are files created when I tried to compile your .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.

Quote:
Originally Posted by Laurence Jackson View Post
OK Gösta, here's a PBR hot from the compiler that works for me
Thanks, L. That did the trick. Just so you know, there were no .pbr's in the zip file.

=================================
"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
Easy Tape (It All Adds UP): http://www.swedesdock.com/easytape
My Ego Site: http://www.SwedesDock.com
PB Newby Tips: http://www.swedesdock.com/powerbasic/pb_shortcuts.html
JWAM: (Quit Smoking): http://www.SwedesDock.com/smoking
Free PB Programs: http://www.swedesdock.com/powerbasic/Programs.shtml
Reply With Quote
  #15  
Old May 26th, 2009, 04:02 AM
Eddy Van Esch Eddy Van Esch is offline
Member
 
Join Date: Jan 2001
Location: Belgium
Posts: 2,015
Laurence,

Nice work. Thanks !

Kind regards
__________________
Eddy
www.devotechs.com -- HIME Huge Integer Math and Encryption library--
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 07:53 PM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Copyright © 1999-2010 PowerBASIC, Inc. All Rights Reserved.