Developer forums (C::B DEVELOPMENT STRICTLY!) > Development

Multi-monitor dialog positioning bug [patch]

<< < (5/9) > >>

280Z28:

--- Quote from: thomas on December 16, 2005, 01:18:54 am ---
--- Code: ---template<wxDialog* D>PlaceDialog()
{
if(Manager::Get()->GetConfigManager("app")->Exists("/environment/place_dialogs"))
    D->CentreOnScreen();
};
--- End code ---
That way, we don't pollute Manager -- this does not belong in there.

--- End quote ---

What file?

Yeah, it didn't seem to belong to any of the others though. Are you saying just put it the global namespace?

rickg22:
Hmmm try xtra_classes.cpp - i made that for your custom classes.

Edit: I don't remember the exact name.

thomas:
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.

280Z28:

--- Quote from: thomas 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.

--- End quote ---

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();
}

--- End code ---

rickg22:
Just a question. Why a template?

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version