Help on Combo boxes for a newbie

Started by Grant McIntosh, May 26, 2014, 07:01:50 AM

Previous topic - Next topic

Grant McIntosh

Hi, I'm sure this question will seem a bit silly, but I'm only learning FF and GUI programming and usually just work with PBCC.

I am setting up an 'Options' area in my program to select certain options. I've made an Options form with a Tab control (thanks to Paul's help file which finally filled in the sticking point of how to get the form onto the Tab control!).  I've added a number of comboboxes for selecting options and I've managed to fill those with the appropriate values, but I want to select / highlight one of those values, depending on what previous options have been saved  - eg. if the list consists of Cat,Dog,Bird,Fish and I need it to select 'Dog' (based on a previously set variable), how do I do that?

I found the FF_ComboBox_AddString stuff somewhere in order to fill the various selections, but after searching the help, various examples and around the forum for a couple of hours, I haven't been able to find a list or help on these things.  Is there some instructions or reference on all these sorts of functions for controls that will help me learn them so I don't have to bothering experienced people with silly newbie questions!?

Thanks

PB10.04
FF3.70
Vista32

PBCC6.04
PBWin10.04
FF3.70
Vista

Paul Squires

Hi Grant,

If you click on the "Functions Library" you will find a number of helper functions that should assist you in using the ComboBox. In this case, you most likely want to use FF_ComboBox_SetCurSel. That function selects an item in the ComboBox. The index to the item is zero-based (rather than one based which PB uses for its DDT controls). So, in you example 'Dog' would be index = 1.

Learning GUI programming can be a daunting task. FireFly is just a tool for facilitating the development. Learning the various controls, etc is outside the scope of the FireFly Help system because it would be an extremely difficult task to document everything about all controls. All of that type of information already exists on Microsoft's website as well as other places on the Internet. The purpose of this forum is to help users with such questions so don't ever feel that there are silly newbie questions.

Paul Squires
PlanetSquires Software

Grant McIntosh

Thanks for the fast response Paul, that's great. I think this was a case of 'information overload', as between the (various) help files, hunting around the program, digging through the examples and hunting around the forum, I got a bit lost, when all the time it was sitting there in FF functions library!  ::)
I had a look up MSDN - yes, makes your head spin a bit. I'd done some minor stuff with VB5 way way back, but had forgotten it all, but never realised there was soooooo many aspects to just one seemingly simple control.

Anyway, I have some good references to go to when I need them next, so that's great.

With your help that part of it now works, so thanks again.

PBCC6.04
PBWin10.04
FF3.70
Vista