Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DLL Talk / BlueGUI Overly Massive Code

Author
Message
Keaz
20
Years of Service
User Offline
Joined: 22nd Sep 2003
Location: Somewhere in south Texas
Posted: 26th Jun 2005 09:05
Here's the issue I'm making a program and it's got a lot of start-up options I've been using BlueGUI to program these and I've now got a ton of if then statements. I'm looking for a way to shrink said code down.

Ex:

and so on and so forth... It's taking a while to get all the option/sub options in there.

Any know an easier/shorter way?

Breaking Stuff=Fun!,Bug Testing<>Fun!, Bug Testing=Breaking Stuff, so...
Bug Testing=Fun! Hmmmm....
DOES NOT COMPUTE! SYSTEM MALFUNTION!
Rob K
Retired Moderator
21
Years of Service
User Offline
Joined: 10th Sep 2002
Location: Surrey, United Kingdom
Posted: 26th Jun 2005 20:44
Gadgets can have an integer associated with them, using setGadgetData. Use setGadgetData to store the item index associated with each gadget, and create an array which holds the handles of all gadgets in your program.

Then the following code would hide and show gadgets as appropriate:




BlueGUI Windows Plugin
Keaz
20
Years of Service
User Offline
Joined: 22nd Sep 2003
Location: Somewhere in south Texas
Posted: 26th Jun 2005 22:21 Edited at: 27th Jun 2005 00:03
Thx again Rob. It's a different approach and it will speed my development process hopefully.

Breaking Stuff=Fun!,Bug Testing<>Fun!, Bug Testing=Breaking Stuff, so...
Bug Testing=Fun! Hmmmm....
DOES NOT COMPUTE! SYSTEM MALFUNTION!
Keaz
20
Years of Service
User Offline
Joined: 22nd Sep 2003
Location: Somewhere in south Texas
Posted: 26th Jun 2005 23:13 Edited at: 27th Jun 2005 00:03
Any more ideas would be appreciacted. [Edited]

Breaking Stuff=Fun!,Bug Testing<>Fun!, Bug Testing=Breaking Stuff, so...
Bug Testing=Fun! Hmmmm....
DOES NOT COMPUTE! SYSTEM MALFUNTION!
Keaz
20
Years of Service
User Offline
Joined: 22nd Sep 2003
Location: Somewhere in south Texas
Posted: 27th Jun 2005 00:02
I looked at it again. I don't think I can do it that way. As shown in the example sometimes different selections show or hide a different object or set of objects. Like in the example case the 3rd selection show 2 objects were selections 1 and 2 only show one. I may have to stick with the long way and just better organize it.

Breaking Stuff=Fun!,Bug Testing<>Fun!, Bug Testing=Breaking Stuff, so...
Bug Testing=Fun! Hmmmm....
DOES NOT COMPUTE! SYSTEM MALFUNTION!
Keaz
20
Years of Service
User Offline
Joined: 22nd Sep 2003
Location: Somewhere in south Texas
Posted: 27th Jun 2005 00:05
Well, I might have figured something out.

Breaking Stuff=Fun!,Bug Testing<>Fun!, Bug Testing=Breaking Stuff, so...
Bug Testing=Fun! Hmmmm....
DOES NOT COMPUTE! SYSTEM MALFUNTION!
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 27th Jun 2005 05:02
You could store a "binary coded" value, to create groups. e.g:


1 - group 1
2 - group 2
4 - group 3
8 - group 4

Then, if you wanted a gadget to belong to group 2 and 4, you would setgadgetdata to 2 + 8...10. You can make this as complex or simple as you need.

BatVink
Keaz
20
Years of Service
User Offline
Joined: 22nd Sep 2003
Location: Somewhere in south Texas
Posted: 27th Jun 2005 05:27
That's just as complex as what I'm doing I've straighten out my code but thanks anyway.

Breaking Stuff=Fun!,Bug Testing<>Fun!, Bug Testing=Breaking Stuff, so...
Bug Testing=Fun! Hmmmm....
DOES NOT COMPUTE! SYSTEM MALFUNTION!
Keaz
20
Years of Service
User Offline
Joined: 22nd Sep 2003
Location: Somewhere in south Texas
Posted: 27th Jun 2005 05:32
The problems was I would've had about 50 groups that way , but I've simplified it. Went from about 1K lines and a bunch of multi-level if...thens to 1 layer of if then and about 800 lines. (it was 450 lines of my) Now only about 250(and that's with even more options added).

Breaking Stuff=Fun!,Bug Testing<>Fun!, Bug Testing=Breaking Stuff, so...
Bug Testing=Fun! Hmmmm....
DOES NOT COMPUTE! SYSTEM MALFUNTION!
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 27th Jun 2005 19:30
Don't know if this helps, but tis is how I handle it...I put groups of gadgets on panels. You can then hide the panel, and everything on it is hidden automatically. It doesn't always suit, and sometimes you have to hide individual gadgets, but it ususally accounts for 50% of what I need to do at any given time.

BatVink
Keaz
20
Years of Service
User Offline
Joined: 22nd Sep 2003
Location: Somewhere in south Texas
Posted: 27th Jun 2005 22:16
Well like I said I cut back about %50 on that section of code a organized it better, so it's on to the next part, but thx for all the ideas anyway.

Breaking Stuff=Fun!,Bug Testing<>Fun!, Bug Testing=Breaking Stuff, so...
Bug Testing=Fun! Hmmmm....
DOES NOT COMPUTE! SYSTEM MALFUNTION!

Login to post a reply

Server time is: 2024-04-25 02:02:16
Your offset time is: 2024-04-25 02:02:16