News:

The new Release 25.03 is out! You can download binaries for Windows and many major Linux distros here .

Main Menu

Was the width of top view saved in CC configure file?

Started by ollydbg, January 16, 2010, 04:15:39 PM

Previous topic - Next topic

MortenMacFly

Quote from: Loaden on January 18, 2010, 08:21:04 AM
I open "default.conf", and can not find a key named "splitterWin".
You have to look for "splitter_pos" in the config file. splitterWin is the ID of the control in the XRC file.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

ollydbg

If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

ollydbg

Just a reminder, I get the wrong behavior in both "float window of Symbols browser" or "docked inside the management pane". Windows XP.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

ollydbg

In windows, I have debug these code in the constructor of ClassBrowser class:

   int pos = cfg->ReadInt(_T("/splitter_pos"), 250);
   XRCCTRL(*this, "splitterWin", wxSplitterWindow)->SetMinSize(wxSize(-1, 200));
   wxSize minSize;
   minSize = XRCCTRL(*this, "splitterWin", wxSplitterWindow)->GetMinSize();
   pos = XRCCTRL(*this, "splitterWin", wxSplitterWindow)->GetSashPosition();
   XRCCTRL(*this, "splitterWin", wxSplitterWindow)->SetSashPosition(450, false);
   pos = XRCCTRL(*this, "splitterWin", wxSplitterWindow)->GetSashPosition();


it is quite strange:
I try to write the "450", but the next statement, I GetSashPosition, it is "pos=96".....


If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Jenna

Quote from: ollydbg on February 26, 2010, 06:27:05 AM
In windows, I have debug these code in the constructor of ClassBrowser class:

   int pos = cfg->ReadInt(_T("/splitter_pos"), 250);
   XRCCTRL(*this, "splitterWin", wxSplitterWindow)->SetMinSize(wxSize(-1, 200));
   wxSize minSize;
   minSize = XRCCTRL(*this, "splitterWin", wxSplitterWindow)->GetMinSize();
   pos = XRCCTRL(*this, "splitterWin", wxSplitterWindow)->GetSashPosition();
   XRCCTRL(*this, "splitterWin", wxSplitterWindow)->SetSashPosition(450, false);
   pos = XRCCTRL(*this, "splitterWin", wxSplitterWindow)->GetSashPosition();


it is quite strange:
I try to write the "450", but the next statement, I GetSashPosition, it is "pos=96".....




As I posted before:

Quote from: jens on January 18, 2010, 07:24:51 AM
The cause for the issue is, that wxWidgets checks if the requested sash position fits inside the windows actual or min-size.

Normally the min-size of the splitter window is the default min size (-1,-1) and the actual size is very small (If I remeber correctly it'S 20 or something like this).

That only happens for the symbols-browser if it is docked inside the management pane, not if it is free-floating.

For me it was enough to set min-height to 200, even if the requested sash-position is greater than 200.
If the min-height is to large, the sash might get hidden, if the management pane is resized.


As we see that does not work on windows.
I can debug this issue on windows, if I find the time.
Maybe it's possible to work around this issue.

ollydbg

Thanks jens. Hope we can find a wrokaround under Windows.

By the way:
I have tried:

    XRCCTRL(*this, "splitterWin", wxSplitterWindow)->SetSashGravity(1.0);
    XRCCTRL(*this, "splitterWin", wxSplitterWindow)->SetSashPosition(0, false);

It is expect that the top window will be resized referring to

http://docs.wxwidgets.org/2.8/wx_wxsplitterwindow.html#wxsplitterwindowsetsashgravity

But the result is still the same, the bottom pane get resized.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

GeO

Hi all,
the problem lies in this code:


m_pClassBrowser = new ClassBrowser(Manager::Get()->GetProjectManager()->GetNotebook(), this);
Manager::Get()->GetProjectManager()->GetNotebook()->AddPage(m_pClassBrowser, _("Symbols"));


First the classbrowser is created only as a child of the Notebook (wrong size)
and then it get assigned to the notebook as page and classbrowser will be resized to the right size.
So i made a patch, where the sashposition will be set after the assigned to the notebook as a page.

I hope you understand, what i would like to say  :lol:

greets GeO

[attachment deleted by admin]

Loaden


ollydbg

@GeO
Thanks a branch!!!
I have applied in my local copy, and it works quite well!!!

I say: this is a bug fix, and should be applied in the trunk before the next official release. :D
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

ollydbg

@jens or Morten

Just a reminder, can you apply this patch to solve the sash bar problem before the next stable C::B release?

Thanks.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Jenna

Quote from: ollydbg on April 27, 2010, 07:23:50 AM
@jens or Morten

Just a reminder, can you apply this patch to solve the sash bar problem before the next stable C::B release?

Thanks.
I just tested it on linux: and it does not work !
Don't know why, no time to digg into it deeper at the moment.

So I am against using it at the moment.

ollydbg

If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Jenna

Quote from: ollydbg on April 27, 2010, 08:45:30 AM
Ok, this patch at least works under Windows. :D
For me it works without this patch on windows (xp sp3, wx2.8.10, gcc 4.4)

Loaden

Until apply this patch, it's works well now. (XPSP3)
Tonight, I will test it in ArchLinux. and will report that.

GeO

Jens, could it be that you are using the symbol browser as a floating pane on linux?
If so this patch should solve it too.

HTH GeO

[attachment deleted by admin]