Page 1 of 1
issue-#45 main window does not refresh during resizing
Posted: Mon May 11, 2015 6:44 am
by Ivan Denisov
Main window does not update content when you resize it. This is important for flexible views, also for toolbars and tabs.
http://redmine.blackboxframework.org/issues/45
Diff:
http://redmine.blackboxframework.org/pr ... e7ffdcfd6d

- issue45.png (29.33 KiB) Viewed 11209 times
This fix applied in CPC rc6, however duplicating code is used.
Code: Select all
class.style := class.style + WinApi.CS_HREDRAW + WinApi.CS_VREDRAW;
this expression is superfluous in case of called earlier:
Code: Select all
class.style := {0, 1, 3, 5}; (* vredraw, hredraw, doubleclicks, privat dc *)
Re: issue-#45 main window does not refresh during resizing
Posted: Fri May 15, 2015 6:46 am
by Ivan Denisov
Josef, there are no comments, because this fix is obvious and already applied in CPC edition.
Let's make voting on this.
Re: issue-#45 main window does not refresh during resizing
Posted: Fri May 15, 2015 7:42 am
by Josef Templ
On my Windows Vista I cannot see any difference in the behavior of the main window
between CPC 1.7 rc5 and BB 1.6.
Can anybody describe a test case where there is a difference
and what that difference is?
- Josef
Re: issue-#45 main window does not refresh during resizing
Posted: Fri May 15, 2015 10:30 am
by Ivan Denisov
If you run Tut -> New View 4/5/6
expand subwindow and move corner of mainwindow you will see that it does not update while button is down.

- 45_fix.png (26.55 KiB) Viewed 11185 times
Re: issue-#45 main window does not refresh during resizing
Posted: Fri May 15, 2015 12:06 pm
by Josef Templ
In my experiments BB1.6 redraws only on extending the window but not on reducing the window.
Anyway, the fix seems reasonable and there is no reason to only redraw on extending the window size.
Shouldn't we use symbolic constants instead of numbers for the style flags?
- Josef
Re: issue-#45 main window does not refresh during resizing
Posted: Fri May 15, 2015 1:15 pm
by Ivan Denisov
Josef Templ wrote:Shouldn't we use symbolic constants instead of numbers for the style flags?
The original line was:
Code: Select all
class.style := {3, 5}; (* doubleclicks, privat dc *)
during
the discussion of this fix OberonCore suggested to keep this style and just extend:
Code: Select all
class.style := {0, 1, 3, 5}; (* vredraw, hredraw, doubleclicks, privat dc *)
Re: issue-#45 main window does not refresh during resizing
Posted: Fri May 15, 2015 3:44 pm
by Josef Templ
It in this case it is clearly better to use symbolic names for all of the flags.
Code: Select all
class.style := CS_VREDRAW + CS_HREDRAW + CS_DBLCLKS + CS_OWNDC;
Why?
Because on many other places within HostWindows also symbolic names are used
instead of hard coded constants. So this is not about introducing a mixture of styles.
It is obvious that the symbolic names simply did not exist in WinApi or its predecessors when
this module has been written. Now it exists and it should be used. Then the comment can be removed.
This is an advantage. Why? Because a comment can easily be inconsistent with the code.
The CPC version does it in the right way, at least in the line that has been added.
- Josef
Re: issue-#45 main window does not refresh during resizing
Posted: Fri May 15, 2015 3:56 pm
by Ivan Denisov
Ok, I updated the repository.
This is the current testing version:
http://blackboxframework.org/unstable/i ... a1.148.zip