Author Topic: parsertest project, Window refresh issue, rev 7788  (Read 38398 times)

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5910
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
parsertest project, Window refresh issue, rev 7788
« on: February 11, 2012, 03:35:27 am »
See the screen shot, it looks like we need to force the main window to refresh when the progress dialog dismissed.


PS: The build-log panel should be refreshed too in some cases (I sometimes see this panel does not refreshed when C::B activated) :)
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.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: parsertest project, Window refresh issue, rev 7788
« Reply #1 on: February 11, 2012, 06:21:53 am »
See the screen shot, it looks like we need to force the main window to refresh when the progress dialog dismissed.

Hmmm... you shouldn't actually see the main window when thee progress dialog is shown as it is hidden (in frame.cpp by calling Hide()). How did you manage to do that? (Doesn't happen here). :o
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5910
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: parsertest project, Window refresh issue, rev 7788
« Reply #2 on: February 11, 2012, 06:33:57 am »
Hmmm... you shouldn't actually see the main window when thee progress dialog is shown as it is hidden (in frame.cpp by calling Hide()). How did you manage to do that? (Doesn't happen here). :o
The screen shot shows that the progress dialog is already closed. but I need to scroll on the textctrl to let the mainframe show its content correctly. This is the same issue when sometimes I see in build-log panel under c::b.

I'm using XP, wx2.8.12.
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.

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5910
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: parsertest project, Window refresh issue, rev 7788
« Reply #3 on: February 15, 2012, 06:36:37 am »
It looks like there is a fatal bug in wxWidgets 2.8.12 (windows).

I even add code like below:
Code
    Show();

    m_LogCtrl->Refresh();
    m_LogCtrl->Update();

But the logCtrl still not refreshed. This is the same behavior as the build-log.

Any one have meet this kind of problem?
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.

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5910
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: parsertest project, Window refresh issue, rev 7788
« Reply #4 on: February 15, 2012, 08:56:24 am »
Ok, I find the reason:

In the wxsmith, the textctrl style has wxTE_RICH2(enabled), if I disable this option, then it refreshes FINE.

I have tried another option which I enable wxTE_RICH, the bug happens again.

I'm not sure what's the exact meaning of those options. See the documents:

Quote
wxTE_RICH  Use rich text control under Win32, this allows to have more than 64KB of text in the control even under Win9x. This style is ignored under other platforms. 
wxTE_RICH2  Use rich text control version 2.0 or 3.0 under Win32, this style is ignored under other platforms 
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.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: parsertest project, Window refresh issue, rev 7788
« Reply #5 on: February 15, 2012, 09:13:36 am »
In the wxsmith, the textctrl style has wxTE_RICH2(enabled), if I disable this option, then it refreshes FINE.
There have been bug reports on this style and many improvements recently in the wx trunk version (a.k.a. 2.9.x) for rich text controls. If its a wx issue I'd say try with wx 2.9.x - if the error is gone, ignore it. In the end it's just a test project.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5910
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: parsertest project, Window refresh issue, rev 7788
« Reply #6 on: February 15, 2012, 09:30:12 am »
In the wxsmith, the textctrl style has wxTE_RICH2(enabled), if I disable this option, then it refreshes FINE.
There have been bug reports on this style and many improvements recently in the wx trunk version (a.k.a. 2.9.x) for rich text controls. If its a wx issue I'd say try with wx 2.9.x - if the error is gone, ignore it. In the end it's just a test project.
Thanks, but the issue also affect the current c::b's source code, see here
Code
wxWindow* TextCtrlLogger::CreateControl(wxWindow* parent)
{
    if (!control)
        control = new wxTextCtrl(parent, -1, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE | wxTE_READONLY | wxTE_RICH | wxTE_NOHIDESEL | wxTE_AUTO_URL);
    return control;
}

Can we remove the "wxTE_RICH" ??  This issue happens for a very long time.
« Last Edit: February 15, 2012, 10:04:06 am by 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.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: parsertest project, Window refresh issue, rev 7788
« Reply #7 on: February 15, 2012, 10:35:03 am »
Can we remove the "wxTE_RICH" ??  This issue happens for a very long time.
I doubt, because we will use the formatting, also it works as expected on linux :)
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5910
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: parsertest project, Window refresh issue, rev 7788
« Reply #8 on: February 15, 2012, 11:28:39 am »
Can we remove the "wxTE_RICH" ??  This issue happens for a very long time.
I doubt, because we will use the formatting, also it works as expected on linux :)

The refresh issue is very annoying under windows.  :(

It looks like wxTE_RICH and wxTE_RICH2 only affect the win32 platform.
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.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: parsertest project, Window refresh issue, rev 7788
« Reply #9 on: February 15, 2012, 11:39:48 am »
The only thing you could do is to test it with wx2.9 from wx's trunk and then report to wx's guys if the problem is still there.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5910
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: parsertest project, Window refresh issue, rev 7788
« Reply #10 on: February 16, 2012, 01:43:15 am »
The only thing you could do is to test it with wx2.9 from wx's trunk and then report to wx's guys if the problem is still there.
OK, I have just create a very simple test project against wx2.8 and wx trunk(2.9.x).

The result is: This issue does NOT happen in the wx trunk.  ;)
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.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: parsertest project, Window refresh issue, rev 7788
« Reply #11 on: February 16, 2012, 01:56:18 am »
Now you can try to find the correct commit and then produce a backport patch (if possible). :)
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: parsertest project, Window refresh issue, rev 7788
« Reply #12 on: February 16, 2012, 08:58:04 am »
Now you can try to find the correct commit and then produce a backport patch (if possible). :)
I wouldn't do it. We will move to wx 2.9 anyways sooner or later and I'd rather not make C::B depend on a self-patched version of wxWidgets.

Instead, you may ask the wxWidgets guys if it is possible to backport this specific stuff to the 2.8 branch (maybe it is already... who knows...).
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: parsertest project, Window refresh issue, rev 7788
« Reply #13 on: February 16, 2012, 09:34:44 am »
Instead, you may ask the wxWidgets guys if it is possible to backport this specific stuff to the 2.8 branch (maybe it is already... who knows...).
I doubt, they'll bother with another version of 2.8.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: parsertest project, Window refresh issue, rev 7788
« Reply #14 on: February 16, 2012, 10:23:35 am »
I doubt, they'll bother with another version of 2.8.
Are you really sure? Because there are plenty of commits on the wx28 branch since v2.8.12, including back-ports from v2.9.x ...
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ