|
| [WD20] Best Practice to Allow User to Scroll a Window |
| Iniciado por guest, 28,sep. 2016 22:37 - 2 respuestas |
| |
| | | |
|
| |
| Publicado el 28,septiembre 2016 - 22:37 |
I have a list of messages I want to display. This list could be long, so it needs to be scrollable. I'm using controlcreate/controlclone to create the static controls for each message. I would use a looper but I want each control to be sized to fit the message. I am currently using an internal window. I pass a data source var from the main window to a procedure in the internal window. I loop through the data source and create a control for each message. The problem is that the internal window is not scrollable unless the height of the internal window is set to more than the height of the internal window control in the editor. If I try to increase the height of the internal window each time I add a message the scrollbar does not show. Below is the code of the procedure.
nYPos is int = STC_Temp..Y nIndex is int = 1 FOR EACH dsMessages IW_Messages..Height += 100 // name of my internal window ControlClone(STC_Temp,"STC_Message" + nIndex,STC_Temp..X,nYPos) {"STC_Message"+nIndex,indControl} = dsMessages.Message nIndex++ nYPos += 112 END STC_Temp..Visible = False |
| |
| |
| | | |
|
| | |
| |
| Publicado el 29,septiembre 2016 - 10:06 |
Hi Curtis,
I use a looper for a similar situation. The looper has a few controls (stcatic, RFT-edit and an image. For every row I calculate the height using the TextHeight() function
Then I set the height of that particular looper-row with LOOP_Messages[nRow]..Height
One thing I discovered is that decreasing the looper-row seems to work better than increasing, which caused some weird redraw issues. So now I set LOOP_Messages[nRow]..Height to 10000 first and set it to the desired height. Also use DieplayEnabled = false/true to improve all. |
| |
| |
| | | |
|
| | |
| |
| Publicado el 29,septiembre 2016 - 15:55 |
| Thanks! I'll give it a try. I did not think you could individually resize looper cells. That's good to know. |
| |
| |
| | | |
|
| | | | |
| | |
|