Author Topic: More ColourDialog fun  (Read 4823 times)

Offline Skywise

  • Single posting newcomer
  • *
  • Posts: 9
More ColourDialog fun
« 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

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: More ColourDialog fun
« Reply #1 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.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline Skywise

  • Single posting newcomer
  • *
  • Posts: 9
Re: More ColourDialog fun
« Reply #2 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

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: More ColourDialog fun
« Reply #3 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.

Offline Skywise

  • Single posting newcomer
  • *
  • Posts: 9
Re: More ColourDialog fun
« Reply #4 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

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: More ColourDialog fun
« Reply #5 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...
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]