Sign in to follow this  
Followers 0
teet

$WS_CLIPCHILDREN and Edit control's scroll bar

7 posts in this topic

Hi,

I have been suffered with this issue for quite a while. Basically when the main window is created with $WS_CLIPCHILDREN, the Edit control which is created inside a tab, will have trouble showing its scroll bars when I switch the tabs. The scroll bars will not show up until I move the mouse upon the edit control. I have tried several creation style and exstyle combination for both the window and the edit controls. No luck. Any suggestions for this scroll bar display issue? Thanks in advance!

My code:

#include <GUIConstants.au3>

#include <WindowsConstants.au3>

#include <EditConstants.au3>

GUICreate("Tabs",1024,700, -1, -1, $WS_MAXIMIZEBOX + $WS_MINIMIZEBOX + $WS_SIZEBOX + $WS_CLIPCHILDREN)

GUISetFont(9, 300)

$tab=GUICtrlCreateTab (10,10, 1000,677)

$tabA=GUICtrlCreateTabitem ("Tab A")

$edit1 = GUICtrlCreateEdit("", 20, 65, 370, 280, $WS_VSCROLL + $WS_HSCROLL + $ES_READONLY)

$tabB=GUICtrlCreateTabitem ( "Tab B")

$edit2 = GUICtrlCreateEdit("", 20, 65, 370, 280, $WS_VSCROLL + $WS_HSCROLL + $ES_READONLY)

GUICtrlSetState(-1,$GUI_SHOW)

GUISetState ()

While 1

$msg = GUIGetMsg()

If $msg = $GUI_EVENT_CLOSE Then ExitLoop

Wend

Share this post


Link to post
Share on other sites



teet,

Welcome to the AutoIt forum. :)

As the $WS_CLIPCHILDREN style "Excludes the area occupied by child windows when drawing occurs within the parent window", it is hardly surprising that your edit controls do not redraw when required! ;)

So why use it in your script? What does it bring you? ;)

By the way, you should use BitOR when combining styles - look at the Setting Styles tutorial in the Wiki to see why. :P

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

Melba,

Thanks for your input! I'll use BitOR from now on ;)

I have a main window which is composed of three parts.

1) There are some icon buttons on top of the window. User can start/pause/stop the application by clicking the icon buttons.

2) In the middle area, an embeded IE object showing multiple website query result.

3) An edit control in the bottom logging the running status.

If I don't use $WS_CLIPCHILDREN, all child windows(icon buttons, Edit control..) will redraw again and again each time the IE object is loading and rendering a page. I don't like this happened. It looks like the whole window keeps on refreshing. So I use $WS_CLIPCHILDREN when creating the main window. Everything works fine to me except the Edit's scroll bars :)

Teet

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Hi! - I have the same problem:

I have a CRichEditCtrl on a CTabCtrl on a CDialog.

I wish to be flickerless everything.

So, both the dialog and the tab is created with WS_CLIPCHILDREN extra style.

But my vertical scrollbar on the CRichEditCtrl does not update during scrolling with mouse.

I had not found better solution than the following:

void CFlickerlessRichEdit::OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)

{

SetScrollPos(SB_VERT, nPos, 0);

CRichEditCtrl::OnVScroll(nSBCode, nPos, pScrollBar);

}

Edited by ArtArt

Share this post


Link to post
Share on other sites

ArtArt,

That does not look like AutoIt syntax and this is the AutoIt forum. Are you sure you are posting in the correct place? :huh:

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

You are right, sorry, I had the same problem in Visual C++. Do you want to remove it? :s

Share this post


Link to post
Share on other sites

ArtArt,

No, we shall leave the posts as a warning to the unwary! ;)

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0