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

2.8 Compilation Error: CentreOnWindow

<< < (2/3) > >>

killerbot:
ok, I will do that, build on windows and commit. Will check later on in linux.

afb:
It built OK for wxMac 2.8 in my sandbox, but that also had all the patches/changes.

killerbot:
committed, BUT doesn't build on linux --> working on it

undefined references to PlaceWindow --> hmm strange, and make clean was of no help

FIXED :I hate ifdefs

thomas:

--- Quote from: killerbot on April 01, 2007, 10:33:54 am ---committed, BUT doesn't build on linux --> working on it

undefined references to PlaceWindow --> hmm strange, and make clean was of no help

FIXED :I hate ifdefs

--- End quote ---
Hahaha... that was why I reverted Patch #1762. :)

You are really unable to tell what's going on with all those #ifdefs. Save the whales, kill #ifdefs instead :)

@Tim:
Although your patch did work just fine (thanks for spotting the issue, above all), I did not like it, sorry :P
For PlaceWindow, it really only makes sense to work on wxToplevelWindow*, if one thinks about it. I originally implemented it to take a wxWindow* because that was the class which contained all the CentreXXX functions (and still does in 2.8, according to the documentation!). The documentation would say "no effect on non-toplevel windows" and I said "yeah, fine with me, makes sense".
It would of course have been no mistake (and maybe more logical) to use wxToplevelWindow* in the first place, since you really only want to position dialogs and frames.

Now, they secretly moved those functions into wxTopLevelWindow (without updating the documentation, and without a fallback), so it would suddenly no longer compile.
Changing the function signature works fine for all versions, and takes no #ifdefs, which is more readable.

As to the other two locations in the reverted patch, cbSplashScreen is a wxFrame (thus it is a wxTopLevelWindow), so it is not necessary to patch anything here.
The call to PlaceWindow inside the config panel dialog is wrong alltogether. It is a relict from the times before all config panels were placed inside a list view (where it of course no longer makes sense to center anything on screen). It used to work without problems in 2.6, so nobody ever noticed. But, the correct solution here is to just delete the offending code alltogether.

stahta01:

--- Quote from: thomas on April 02, 2007, 10:25:12 am ---@Tim:
Although your patch did work just fine (thanks for spotting the issue, above all), I did not like it, sorry :P
For PlaceWindow, it really only makes sense to work on wxToplevelWindow*, if one thinks about it. I originally implemented it to take a wxWindow* because that was the class which contained all the CentreXXX functions (and still does in 2.8, according to the documentation!). The documentation would say "no effect on non-toplevel windows" and I said "yeah, fine with me, makes sense".
It would of course have been no mistake (and maybe more logical) to use wxToplevelWindow* in the first place, since you really only want to position dialogs and frames.

--- End quote ---

Yeah, you solution is much better than mine was, but I did NOT know enough to do your's at the time.
Do NOT think that I would have seen it even if I fixed it now.

Tim S

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version