Code::Blocks Forums

User forums => General (but related to Code::Blocks) => Topic started by: Skywise on July 12, 2014, 06:25:32 am

Title: More ColourDialog fun
Post by: Skywise on July 12, 2014, 06:25:32 am
CodeBlocks 13.12 - wxWidgets 3.0.0 static

On windows, color dialogs have an option for custom colors.

When adding a ColourDialog to a frame via wxSmith, there is a check box option 'Full dialog'. Checking this is supposed to bring up the full color dialog with custom colors already opened. For example, the ColorPickerCtrl does this.

However, it doesn't work.

When unchecked, the frame constructor has the line,

__ColourData_1.SetChooseFull(false);

which turns off the custom colors.

When checking the box, this line is removed completely, so the dialog is left to the default which is the same condition, no custom colors.

Instead, it should change the boolean to true. Manually doing this gives me the desired behavior, but of course it gets deleted when I make any changes to the frame.

I've only tested this on XP so don't know if it's across windows versions or not.

Brian
Title: Re: More ColourDialog fun
Post by: oBFusCATed on July 12, 2014, 12:01:37 pm
You can place the code outside the wxSmith block and it won't get deleted. Otherwise it is better to post a patch, I doubt it would be that hard to do.
Title: Re: More ColourDialog fun
Post by: Skywise on July 12, 2014, 09:05:59 pm
You can place the code outside the wxSmith block and it won't get deleted.

If you mean the commented out block in the constructor, just tried and it doesn't have any effect.


Otherwise it is better to post a patch, I doubt it would be that hard to do.

Even though I've been programming for decades, I'm basically a noob to wxWidgets, CodeBlocks, and C++. I'm still in that "I know enough to be dangerous" stage.

So I figured mentioning it would let someone else who knows what they're doing fix it.

Brian
Title: Re: More ColourDialog fun
Post by: Jenna on July 12, 2014, 11:27:26 pm
The wxxWidgets docs state clearly that the default value is true !
Testing it with "GetChooseFull()" always returns "false", so the docs seem to be incorrect or the implementation is buggy.

As workaround you can add "ColourDialog1->GetColourData().SetChooseFull(true);" as "Extra code" of the wxColourDialog in wxSmith.
You have to fix the name of the dialog so it fitsyour settings.
Title: Re: More ColourDialog fun
Post by: Skywise on July 13, 2014, 12:22:15 am
As workaround you can add "ColourDialog1->GetColourData().SetChooseFull(true);" as "Extra code" of the wxColourDialog in wxSmith.
You have to fix the name of the dialog so it fitsyour settings.

Thank you!!! I'm happy with this.

I was trying to figure out that solution but couldn't figure out the correct format.

I'm still struggling with C's obsession with pointers. As I said, I'm a noob.  ;D

Brian
Title: Re: More ColourDialog fun
Post by: oBFusCATed on July 13, 2014, 12:44:59 am
Hm, Jens solution is better. Mine solution has been something like:
1. go to the contrutor
2. find the wxSmith block
3. place your code after the block, so it didn't get erased by wxSmith...