Author Topic: Multi-monitor dialog positioning bug [patch]  (Read 51225 times)

Offline 280Z28

  • Regular
  • ***
  • Posts: 397
  • *insert unicode here*
Re: Multi-monitor dialog positioning bug [patch]
« Reply #15 on: December 15, 2005, 02:12:05 pm »
No objection from my side if it is an option.

What about simple message boxes? Are those consistent with the other dialogs  with your modifications?

Not sure which ones are simple. I just changed all the ones that call LoadDialog() in their constructor (since that was easy to search for).

I'll make it an option tonight and post a new patch.
78 280Z, "a few bolt-ons" - 12.71@109.04
99 Trans Am, "Daily Driver" - 525rwhp/475rwtq
 Check out The Sam Zone :cool:

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: Multi-monitor dialog positioning bug [patch]
« Reply #16 on: December 15, 2005, 02:42:41 pm »
OK, I haven't stepped in this discussions since I don't really care about the subject :P (I work on a single monitor setup). So I 'll let you, who have dual monitor setups,  resolve this.

But, 280Z28, do *not* post patches here. They are only going to be lost/forgotten. Patches should be submitted to the patch tracker. That's what we have it for. A forum is *not* a project management tool or medium...
Be patient!
This bug will be fixed soon...

Offline 280Z28

  • Regular
  • ***
  • Posts: 397
  • *insert unicode here*
Re: Multi-monitor dialog positioning bug [patch]
« Reply #17 on: December 15, 2005, 02:43:39 pm »
OK, I haven't stepped in this discussions since I don't really care about the subject :P (I work on a single monitor setup). So I 'll let you, who have dual monitor setups,  resolve this.

But, 280Z28, do *not* post patches here. They are only going to be lost/forgotten. Patches should be submitted to the patch tracker. That's what we have it for. A forum is *not* a project management tool or medium...

Yeah I just saw that in another thread. I didn't realize you were using it. :)
78 280Z, "a few bolt-ons" - 12.71@109.04
99 Trans Am, "Daily Driver" - 525rwhp/475rwtq
 Check out The Sam Zone :cool:

Offline 280Z28

  • Regular
  • ***
  • Posts: 397
  • *insert unicode here*
Re: Multi-monitor dialog positioning bug [patch]
« Reply #18 on: December 16, 2005, 01:03:54 am »
OK I'm ready to make this an option. I need to add the following function to the SDK. Where should I put it, and what class should it be a public member of? I'm thinking Manager.

Code
static void Manager::PositionUserDialog( wxDialog* dlg )
{
    if (user wants dialogs repositioned centered on parent)
    {
        dlg->CenterOnScreen();
    }
}
78 280Z, "a few bolt-ons" - 12.71@109.04
99 Trans Am, "Daily Driver" - 525rwhp/475rwtq
 Check out The Sam Zone :cool:

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: Multi-monitor dialog positioning bug [patch]
« Reply #19 on: December 16, 2005, 01:18:54 am »
Code
template<wxDialog* D>PlaceDialog()
{
if(Manager::Get()->GetConfigManager("app")->Exists("/environment/place_dialogs"))
    D->CentreOnScreen();
};
That way, we don't pollute Manager -- this does not belong in there.

EDIT: Don't blame me if I have a typo in there... it is late, and I am falling asleep... But you get the idea :)
« Last Edit: December 16, 2005, 01:21:38 am by thomas »
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline 280Z28

  • Regular
  • ***
  • Posts: 397
  • *insert unicode here*
Re: Multi-monitor dialog positioning bug [patch]
« Reply #20 on: December 16, 2005, 01:20:24 am »
Code
template<wxDialog* D>PlaceDialog()
{
if(Manager::Get()->GetConfigManager("app")->Exists("/environment/place_dialogs"))
    D->CentreOnScreen();
};
That way, we don't pollute Manager -- this does not belong in there.

What file?

Yeah, it didn't seem to belong to any of the others though. Are you saying just put it the global namespace?
78 280Z, "a few bolt-ons" - 12.71@109.04
99 Trans Am, "Daily Driver" - 525rwhp/475rwtq
 Check out The Sam Zone :cool:

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Re: Multi-monitor dialog positioning bug [patch]
« Reply #21 on: December 16, 2005, 01:21:40 am »
Hmmm try xtra_classes.cpp - i made that for your custom classes.

Edit: I don't remember the exact name.

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: Multi-monitor dialog positioning bug [patch]
« Reply #22 on: December 16, 2005, 01:23:15 am »
But you'd rather put the template in the header, not the cpp

EDIT:
... and you will want to add the void which I forgot, or the compiler won't let you get away.
« Last Edit: December 16, 2005, 01:25:27 am by thomas »
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline 280Z28

  • Regular
  • ***
  • Posts: 397
  • *insert unicode here*
Re: Multi-monitor dialog positioning bug [patch]
« Reply #23 on: December 16, 2005, 01:28:23 am »
But you'd rather put the template in the header, not the cpp

EDIT:
... and you will want to add the void which I forgot, or the compiler won't let you get away.

Yep I was a step ahead of you there. I have this in sdk\xtra_classes.h:

Code
template<wxDialog* D> void PositionUserDialog(bool force=false)
{
    if(force || Manager::Get()->GetConfigManager("app")->Exists("/environment/place_dialogs"))
        D->CenterOnScreen();
}
« Last Edit: December 16, 2005, 01:33:10 am by 280Z28 »
78 280Z, "a few bolt-ons" - 12.71@109.04
99 Trans Am, "Daily Driver" - 525rwhp/475rwtq
 Check out The Sam Zone :cool:

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Re: Multi-monitor dialog positioning bug [patch]
« Reply #24 on: December 16, 2005, 01:39:13 am »
Just a question. Why a template?

Offline 280Z28

  • Regular
  • ***
  • Posts: 397
  • *insert unicode here*
Re: Multi-monitor dialog positioning bug [patch]
« Reply #25 on: December 16, 2005, 01:42:51 am »
Just a question. Why a template?

I actually already made it not a template. :o
78 280Z, "a few bolt-ons" - 12.71@109.04
99 Trans Am, "Daily Driver" - 525rwhp/475rwtq
 Check out The Sam Zone :cool:

Offline 280Z28

  • Regular
  • ***
  • Posts: 397
  • *insert unicode here*
Re: Multi-monitor dialog positioning bug [patch]
« Reply #26 on: December 16, 2005, 02:17:32 am »
Why are there sooo manyy blank lines with just trailing spaces in env_settings.xrc?
78 280Z, "a few bolt-ons" - 12.71@109.04
99 Trans Am, "Daily Driver" - 525rwhp/475rwtq
 Check out The Sam Zone :cool:

Offline 280Z28

  • Regular
  • ***
  • Posts: 397
  • *insert unicode here*
Re: Multi-monitor dialog positioning bug [patch]
« Reply #27 on: December 16, 2005, 04:11:08 am »
Applies cleanly to rev 1524. There are a ton of files updated, so chances of a conflict if this is outstanding for a while is high.

I did not make any changes to surrounding whitespace. I only made the required changes to fix this one bug.

The new option is on the view tab of environment settings.

Sam 8)

[attachment deleted by admin]
78 280Z, "a few bolt-ons" - 12.71@109.04
99 Trans Am, "Daily Driver" - 525rwhp/475rwtq
 Check out The Sam Zone :cool:

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5519
Re: Multi-monitor dialog positioning bug [patch]
« Reply #28 on: December 16, 2005, 07:40:25 am »
(I work on a single monitor setup).

Dual monitor is superb during coding and debugging. That nasty gui you are debugging is always visible (you drag it on the other screen) and when you hit your breakpoint you can still see it nicely. It helped me a lot in my M$ devstudio gui projects, otherwise the IDE get's focus on the breakpoint or the code you are stepping through and you don't see the GUI window anymore since it's behind the IDE window.

And it is also very nice, to have on a second monitor a Firefox open on the CB page, forum page, so you can check from time to time for the new information.
;-)

I am kinda missing Yiannis's today's changes (well I see them in svn anyway).

Maybe we should buy Yiannis a second monitor for x-mas ...

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: Multi-monitor dialog positioning bug [patch]
« Reply #29 on: December 16, 2005, 03:58:11 pm »
Applies cleanly to rev 1524. There are a ton of files updated, so chances of a conflict if this is outstanding for a while is high.

I did not make any changes to surrounding whitespace. I only made the required changes to fix this one bug.

The new option is on the view tab of environment settings.

Sam 8)

Just tell me Sam: how many times do I have to repeat myself about not posting patches in the forums?  :?
Be patient!
This bug will be fixed soon...