User forums > Using Code::Blocks

Bring C::B to front when opening file via command line

<< < (2/3) > >>

MortenMacFly:

--- Quote from: daniloz on May 25, 2012, 09:28:00 am ---Attached is a patch to fix it...

--- End quote ---
Great, will try...


--- Quote from: daniloz on May 25, 2012, 09:28:00 am ---Thanks MortenMacFly for the suggestion, I also think that IsIconized() is the right check here. However, instead of Show(), I'am issuing a Iconize(false), since the documentation says that Show() is the opposite of Hide(), whereas here I've found that Iconize(false) is what I want.

--- End quote ---
That is true. I didn't consult the docs, but from what I see now it is the right thing to do.


--- Quote from: daniloz on May 25, 2012, 09:28:00 am ---Do you have another version of wxWidgets??  :o

--- End quote ---
No, all methods of wxWidgets are usually available in British and American English. We had this discussion just recently that we agreed to use the British English variant, if available. Documented are generally only the American versions... IMHO... To check, you have to open the interface (header) file, or just try if the compiler complains when using the British one... ;-)

daniloz:

--- Quote from: MortenMacFly on May 25, 2012, 10:32:47 am ---No, all methods of wxWidgets are usually available in British and American English. We had this discussion just recently that we agreed to use the British English variant, if available. Documented are generally only the American versions... IMHO... To check, you have to open the interface (header) file, or just try if the compiler complains when using the British one... ;-)

--- End quote ---

It seems that this time, only American versions are available... ;)

--- Code: ---C:\Work\codeblocks_trunk\src\src\app.cpp:139:26: error: 'class MainFrame' has no member named 'IsIconised'
C:\Work\codeblocks_trunk\src\src\app.cpp:140:14: error: 'class MainFrame' has no member named 'Iconise'

--- End code ---

MortenMacFly:

--- Quote from: daniloz on May 25, 2012, 10:41:06 am ---It seems that this time, only American versions are available... ;)

--- End quote ---
OK - so it seems the wx guys are in-consequent or changed their philosophy. Nevermind.

However, I wonder if instead of:

--- Code: ---        if (m_Frame)
        {
            if (m_Frame->IsIconized())
                m_Frame->Iconize(false);
            else
                m_Frame->Raise();
        }

--- End code ---
...you should write:

--- Code: ---        if (m_Frame)
        {
            if (m_Frame->IsIconized())
                m_Frame->Iconize(false);
            m_Frame->Raise();
        }

--- End code ---
? Or does Iconize(false) also raises the window automatically?

daniloz:

--- Quote from: MortenMacFly on May 25, 2012, 10:54:24 am ---Or does Iconize(false) also raises the window automatically?

--- End quote ---
As far as I can see/test, it also raises the window automatically.

What I did to test was to have the codeblocks window opened, then I maximized another window to cover it and clicked on the windows taskbar in order to iconize codeblocks. After calling it from the command line to open a file, the codeblocks window was de-iconized and was on top of all windows, i.e. I could see it. :D So, to me, just the call to Iconize(false) is enough...

Since I have no much experience with these things (windows, z-level, iconize etc..), do you have any other idea/concern/suggestion/test case? ;)

MortenMacFly:

--- Quote from: daniloz on May 25, 2012, 11:02:43 am ---do you have any other idea/concern/suggestion/test case? ;)

--- End quote ---
No, but I know that iconising and raising are two different things. So to be on the safe side, I would always raise. This might be a platform / configuration thing, too. For example, on Windows there is a switch to (dis-) allow stealing the focus of windows globally which affects Raise().

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version