PlanetSquires Forums

Support Forums => Other Software and Code => Topic started by: Ivan Iraola on November 06, 2009, 10:53:39 AM

Title: FF_Functions for controls
Post by: Ivan Iraola on November 06, 2009, 10:53:39 AM
I would be nice if there were FF_Functions for other controls such as TRACKBAR, HSCROLLBAR, VSCROLLBAR, etc.
Title: Re: FF_Functions for controls
Post by: Paul Squires on November 06, 2009, 11:49:49 AM
If you (or anyone else) have any functions written for those controls then I would be more than happy to include them as part of the standard FF3 distribution.
Title: Re: FF_Functions for controls
Post by: José Roca on November 06, 2009, 12:35:45 PM
Quote
If you (or anyone else) have any functions written for those controls then I would be more than happy to include them as part of the standard FF3 distribution.

My headers include wrapper functions and macros for each and every one message of all Windows common controls:

AnimateCtrl.inc (Animation control)
ButtonCtrl.inc (Button control)
ComboBoxCtrl.inc (ComboBox control)
ComboBoxExCtrl.inc (ComboBoxEx control)
DateTimeCtrl.inc (Date Time control)
EditCtrl.inc (Edit control)
HeaderCtrl.inc (Header control)
HotKeyCtrl.inc (Hot Key control)
IPAddressCtrl.inc (IP Address control)
ListBoxCtrl.inc (ListBox control)
ListViewCtrl.inc (ListView control)
MonthCalCtrl.inc (Month Calendar control)
PagerCtrl.inc (Pager control)
ProgressBarCtrl.inc (Progress Bar control)
RebarCtrl.inc (Rebar control)
RichEditCtrl.inc (Rich Edit control)
ScrollBarCtrl.inc (Scroll Bar control)
StaticCtrl.inc (Static control)
StatusbarCtrl.inc (Status Bar control)
SysLinkCtrl.inc (SysLink control)
TabCtrl.inc (Tab control)
TaskDialogCtrl.inc (Task Dialog control)
ToolbarCtrl.inc (Toolbar control)
TrackbarCtrl.inc (Track Bar control)
TreeViewCtrl.inc (TreeView control)
UpDownCtrl.inc (UpDown control)

And are documented here:

http://www.jose.it-berater.org/comctrl/iframe/index1.htm
http://www.jose.it-berater.org/comctrl/iframe/index1.htm
Title: Re: FF_Functions for controls
Post by: Rolf Brandt on November 06, 2009, 12:48:26 PM
I can only recommend to have look at Josè's website. If you need code for any functionality of a common control you can be shure to find it there. Even if you are new to PB it is very easy to use his wrappers.
Title: Re: FF_Functions for controls
Post by: Paul Squires on November 06, 2009, 01:00:43 PM
I agree. There is rarely nothing PB/WinAPI related that I can't find on Jose's site. Rather than reinventing the wheel with a multitude of additional FF Functions, it probably would be a better exercise to educate users on where to find PB-Friendly functions that handle win api stuff. Jose's website would be my first stop.

No need to create more FF Functions that wrap a wrapper in a wrapper.

Title: Re: FF_Functions for controls
Post by: José Roca on November 06, 2009, 01:26:28 PM
 
With 900+ include files, they provide access to all the Windows API and the COM subsystem.

Also, accessible from my web page, there are many reference guides that use the PB syntax instead of MSDN C++ syntax.

Accessibility
ADO/ADOX
CDO
Common Controls I
Common Controls II
GDI
GDI+ Flat API
MSXML
ODBC
PSAPI
Rich Edit Control
SDL
Structured Storage
System Information
Task Scheduler
Visual Styles
WebBrowser Control
Windows Script
WinHTTP
WMI

http://www.jose.it-berater.org/index.html

And there are many hundreds of examples in my forum.

I haven't promoted them in the PB forum because there are mostly interested in DDT, but since FireFly users will have to use SDK, they can greatly benefit using them.

I will prepare version 1.15 incorporating the latest updates.
Title: Re: FF_Functions for controls
Post by: Ivan Iraola on November 06, 2009, 01:35:19 PM
Great, thank you. I'll sign up and get those INC.

Quote
No need to create more FF Functions that wrap a wrapper in a wrapper.

I agree, but since it's FF it would be logical to have "native" FF functions, but that's just my opinion.  ;)

Title: Re: FF_Functions for controls
Post by: Haakon Birkeland on November 06, 2009, 02:33:49 PM
QuoteAnd are documented here:

I assume you intended to have a second link to the "More ..." page, so the links are;

http://www.jose.it-berater.org/comctrl/iframe/index1.htm for

• Macros
• Animation Control
• Button Control
• ComboBox Control
• ComboBoxEx Control
• Date and Time Picker Control
• Drag List Box Control
• Edit Control
• Flat Scroll Bar Control
• Header Control
• Hot Key Control
• Image List Control
• IP Address Control
• List Box Control
• List-View Control
• Month Calendar Control

and http://www.jose.it-berater.org/comctrl/iframe/index2.htm for

• Macros
• Pager Control
• Progress Bar Control
• Property Sheet Control
• Rebar Control
• Scroll Bar Control
• Static Control
• Status Bar Control
• SysLink Control
• Tab Control
• Task Dialog Control
• Toolbar Control
• Tooltip Control
• Trackbar Control
• Tree-View Control
• Up-Down Control
Title: Re: FF_Functions for controls
Post by: John Montenigro on November 07, 2009, 04:23:14 PM
Quote from: Rolf Brandt on November 06, 2009, 12:48:26 PM
... Even if you are new to PB it is very easy to use his wrappers.

"How easy?" "Very easy."

But HOW do you use them? Is there an explanation anywhere that can help someone like me (not familiar with Jose's wrappers) get set up to use them?

Thanks,
-John
Title: Re: FF_Functions for controls
Post by: Paul Squires on November 07, 2009, 05:29:59 PM
What exactly do you need help with? I can't explain how to use every wrapper available. That would be impossible. There are hundreds and hundreds of functions and wrappers. Each function on Jose's site has a description that indicates what it is used for. The links to Jose's site clearly shows the categories of controls available and under each control are the Constants, Structures, Functions and Wrappers related to it.

For the most part, all you need to do is to ensure that you have set the Project Setting to use Jose Roca's Includes (rather than the PB Includes). This will point FF3 to use the includes as defined in the Compiler setup (Environment Options). Of course, you still need to download Jose's includes and install them on your computer. Once that is done then you can freely use any of Jose's wrappers related to the control in question and FF3 will happily compile it into your EXE.


Title: Re: FF_Functions for controls
Post by: José Roca on November 07, 2009, 08:14:06 PM
Quote
There are hundreds and hundreds of functions and wrappers.

Around 18,000. And you have to add the interface declarations, with thousands of methods and properties (more than 80,000).
Title: Re: FF_Functions for controls
Post by: Paul Squires on November 07, 2009, 10:28:59 PM
Quote from: Jose Roca on November 07, 2009, 08:14:06 PM
Around 18,000. And you have to add the interface declarations, with thousands of methods and properties (more than 80,000).
With that many functions it always amazes me why some people have such a resistance to wanting to learn aspects of the Windows API. There is so much power available at our fingertips but yet many people cringe whenever the "API" term is used. For just about anything you need to do there exists a set of functions to accomplish the task. Calling a WinAPI function is just as easy as calling a native PB function... actually, most of the time it can be even easier!  :)

PB programmers need to expand their boundaries away from just DDT or some EZ this or EZ that. Everything is available to us and it is free for the taking. Luckily, FireFly users seem more willing to explore the WinAPI.

Hopefully I can help by creating some tutorials that at least highlight some of the most common API functions (e.g. GetClientRect, GetWindowRect, SetWindowPos, SetFocus, ShowWindow, EnableWindow, etc...).

Title: Re: FF_Functions for controls
Post by: Ivan Iraola on November 08, 2009, 12:20:16 AM
QuoteWith that many functions it always amazes me why some people have such a resistance to wanting to learn aspects of the Windows API

I believe that the main problem is the lack of good and simple examples or tutorials, personally, I'd love to learn more about the WinAPI but whatever documentation I find (books or online) are always lacking clarity, so, the fast way to get what you need to do is to EZ this or EZ that.

FireFly is indeed a good tool, which I enjoy using along with PB, but sometimes is a little frustrating when you want or need to do something and you have to stop because either you don't know which API might be the right one or how in the heck you use it.
Title: Re: FF_Functions for controls
Post by: Haakon Birkeland on November 08, 2009, 05:46:32 AM
I think Ivan is into one of the main reasons regarding tapping into the vast resource the API is â€" availability. Most people just don't know where and what to look for.

When I bought my first VB, ages ago, I read through the reference book and highlighted all the commands that I knew I would use and those that I wanted to use â€" because they did cool stuff.

Nobody would do this with 18.000+ functions, even though they are grouped. Looking through the 900+ include files, I don't even have a clue what most of them contain functions for.

Earlier I used Dan Applemans API bible for VB users, and I see that Jose has taken his role for the PB community â€" tenfold, and then some!
Title: Re: FF_Functions for controls
Post by: Rolf Brandt on November 08, 2009, 06:12:57 AM
Yep - Dan Appleman's 'Programmers Guide to WIN32 API', that's what my eyes fell on when I read this thread. It's still standing in my bookshelf. (Even found the Barnes & Noble receipt still in it.)

Good comparison: Jose, the Appleman of PB!

Rolf
Title: Re: FF_Functions for controls
Post by: Haakon Birkeland on November 08, 2009, 09:59:15 AM
I think I might still have have two of the books laying around if I look for the first one in the basement. Actually I recall the first API I used from it being a function to search the content of a listbox as I found the limited VB-way of doing it in a longer list to yield undesirable visual artifacts.

The helpfile from the book have been a companion to POFFs for years, but I see myself only following the "next great master" â€" Jose in the future. He is like Paul (and some few others) by no doubt one of the "faces" of PB that unselfishly serves the community with his wast knowledge.
Title: Re: FF_Functions for controls
Post by: John Montenigro on November 08, 2009, 11:36:53 AM
Quote from: TechSupport on November 07, 2009, 05:29:59 PM
What exactly do you need help with? I can't explain how to use every wrapper available. That would be impossible. There are hundreds and hundreds of functions and wrappers.
I understand and agree...but how about something at a more general, or conceptual level?

Over the years (after having finally made the transition away from DOS), I have been learning the Win API.

So maybe a couple of comparisions would be helpful -
- whereas an API call is like this, Jose's calls are like that...
- here's how you've been using the Windows API, and here's how you use Jose's functions...
- if you did stuff like X with the API, you need to do things like Y with Jose's...

I promise to go back to Jose's site and re-read. It's been a long time since I tried, but I'll give it another go. However, I know it would be helpful if I had a better context by which to understand what makes them different from API functions.

In that regard, I hope someone can offer some easy-to-understand help.

Thanks,
-John
Title: Re: FF_Functions for controls
Post by: José Roca on November 08, 2009, 12:39:25 PM
Quote
So maybe a couple of comparisions would be helpful -
- whereas an API call is like this, Jose's calls are like that...
- here's how you've been using the Windows API, and here's how you use Jose's functions...
- if you did stuff like X with the API, you need to do things like Y with Jose's...

I'm afraid we will need some examples to understand what you mean. Otherwise, how on Earth can we know how have you been using the API?
Title: Re: FF_Functions for controls
Post by: Haakon Birkeland on November 08, 2009, 01:06:20 PM
It's not like the wrappers in basic are a reinvention of the wheel and totally different to the original code, but rather translated and made ready for use with PowerBASIC's syntax and variable types. It is still the same library that is called and "does the math".

Use Jose's wrappers in conjunction with the reference section on his pages and you'll find using basic API-calls/functions easier than if you have to read and understand the C code that you normally find on the net.

Compare the somewhat cryptic syntax below ...


int ListBox_FindString(
HWND hwndCtl,
int indexStart,
LPCTSTR lpszFind
);


... with this ...


FUNCTION Listbox_FindString ( _
BYVAL hListBox AS DWORD, _
BYVAL indexStart AS DWORD, _
BYVAL searchString AS STRING _
) AS LONG


Its not only easier to understand for those lacking C skills, but it is ready for use when the include is â€" included. Constants one would need for arguments are defined and the declaration of the function exported by the supporting library is pre-declared for you.

Copy the code, fill in the blanks (substitute the arguments with real life values or reference the variables holding them) and run the show ...
Title: Re: FF_Functions for controls
Post by: John Heathcote on November 08, 2009, 03:06:03 PM
Paul,

QuoteWith that many functions it always amazes me why some people have such a resistance to wanting to learn aspects of the Windows API. There is so much power available at our fingertips but yet many people cringe whenever the "API" term is used. For just about anything you need to do there exists a set of functions to accomplish the task. Calling a WinAPI function is just as easy as calling a native PB function... actually, most of the time it can be even easier!  :)

To personally put this into context, it isn't so much resisting the API learning curve, it is more a matter of where to start.  As Jose stated:

QuoteAround 18,000. And you have to add the interface declarations, with thousands of methods and properties (more than 80,000).

...is more than enough to give me the API heebie jeebies.  :D

I can't tell you how many times I've been frustrated using the API, wanting to do something apparently simple and specific with the API, so I gather my equates, function calls etc., insert them in my code only to discover they don't work.  No GPF, but no real reason why things didn't work, GetLastError is of no help either.  So I ask a question in the forums about why XYZ didn't work and the response is, "Oh, you have to do ABC first."  Huh?  Where is that mentioned in the API?

POFFS is a great help as an aid to solve problems, but there are pitfalls too, particularly when POFFS code fails to compile.  So now what do you do?  Spend time getting POFFS examples to work or do something else?  This is the real world for me, and if I didn't love pain so much I would probably give up programming.   ;D

Again, I can't tell you how many days, even weeks I've wasted trying to get something to work, so for me productivity (or the lack of it) is a big factor in my decision to use API stuff.  The Win32 Programmers Reference is a help too, but it appears to be somewhat outdated.  The Platform Development Kit would be a wonderful thing to use, but it doesn't work on my system (I think I may be missing an upgrade, or two).  So essentially I have the WIN32API.inc file, or Jose's include files to look at.

QuotePB programmers need to expand their boundaries away from just DDT or some EZ this or EZ that. Everything is available to us and it is free for the taking. Luckily, FireFly users seem more willing to explore the WinAPI.

I don't disagree, but again, where do you start?  It would be nice if all PB users could gain the experience that you, Jose, and all of the other great PB gurus have gathered over the years so we would know where to start, but that isn't likely to happen as we all have differing programming goals.  Although I do benefit from your programming experiences (as well as Jose's and the host of other power users) I can honestly say I will probably never come close to achieving power user status.  I accept that, but I also think you have to consider that some of us don't want to get into that much detail with the API, we simply want our efforts to work as we have planned. 

An explanation of why things work is always nice and I try to include this info in my code, but I'm not disappointed if such an explanation is not forthcoming.  It works!

QuoteHopefully I can help by creating some tutorials that at least highlight some of the most common API functions (e.g. GetClientRect, GetWindowRect, SetWindowPos, SetFocus, ShowWindow, EnableWindow, etc...).

Not just examples, but practical examples that do some real world work.  A sort of "How do I" facility would be most welcome.

Just one old geezer's opinion.

JR