 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
Tekl
Joined: 24 Sep 2004 Posts: 813 Location: Germany
|
Posted: Fri Mar 04, 2005 8:36 am Post subject: Scrolling a control's content in pixel-steps |
|
|
Hello,
is it true that it is not possible to scroll a control pixel by pixel? I googled for WM_VSCROLL and found a newsgroup-thread where someone claimed it is not possible.
Tekl
Last edited by Tekl on Fri Mar 04, 2005 1:09 pm; edited 1 time in total |
|
| Back to top |
|
 |
BoBo Guest
|
Posted: Fri Mar 04, 2005 9:08 am Post subject: |
|
|
| Quote: | GuiControl, Sub-command, ControlID [, Param3]
Move: Moves and/or resizes the control. Specify one or more of the following option letters in Param3: X (the x-coordinate relative to the GUI window's client area, which is the area not including title bar, menu bar, and borders); Y (the y-coordinate), W (Width), H (Height). Example: x10 y20 w200 h100 |
| Code: | Gui, Add, Button, Default vMyButton, &OK
Loop, 30
{
GuiControl, Move, MyButton, x%A_Index% y10
} |
I guess you've tested already something similar ... |
|
| Back to top |
|
 |
Tekl
Joined: 24 Sep 2004 Posts: 813 Location: Germany
|
Posted: Fri Mar 04, 2005 10:11 am Post subject: |
|
|
Hi Bobo,
I don't want to move or resize a control. I want to scroll the content of a control and it should not only work in the ahk-gui.
Tekl |
|
| Back to top |
|
 |
BoBo Guest
|
Posted: Fri Mar 04, 2005 10:36 am Post subject: |
|
|
| Quote: | Control
--------------------------------------------------------------------------------
Makes a variety of changes to a control.
Control, Cmd [, Value, Control, WinTitle, WinText, ExcludeTitle, ExcludeText]
Choose, N: Sets the selection in a ListBox or ComboBox to be the Nth entry. N should be 1 for the first entry, 2 for the second, etc. To select or deselect all items in a multi-select listbox, follow these examples:
PostMessage, 0x185, 1, -1, ListBox1, WinTitle ; Select all listbox items. 0x185 is LB_SETSEL.
PostMessage, 0x185, 0, -1, ListBox1, WinTitle ; Deselect all listbox items.
ChooseString, String: Sets the selection (choice) in a ListBox or ComboBox to be the entry whose leading part matches String. The search is not case sensitive. For example, if a ListBox/ComboBox contains the item "UNIX Text", specifying the word unix (lowercase) would be enough to select it. | So that won't cover it as well ? |
|
| Back to top |
|
 |
BoBo Guest
|
Posted: Fri Mar 04, 2005 10:45 am Post subject: |
|
|
Ehm, have ignored the "pixel steps"-requirement. So the above won't cover it, definitely
@ Toralf
maybe you can edit the topic to: Scrolling a control's content in pixel-steps
I guess you mean a Teleprompter look-a-like.  |
|
| Back to top |
|
 |
toralf
Joined: 31 Jan 2005 Posts: 3841 Location: Bremen, Germany
|
Posted: Fri Mar 04, 2005 11:38 am Post subject: |
|
|
Please BoBo,
I'm neither Titan nor Tekl. _________________ Ciao
toralf  |
|
| Back to top |
|
 |
BoBo Guest
|
Posted: Fri Mar 04, 2005 12:11 pm Post subject: |
|
|
@ toralf
von wem war nochmal der Song: "You are always on my mind" ???
Sorry, war keine böse Absicht.
Also, machs gut Chris (just kidding)  |
|
| Back to top |
|
 |
Tekl
Joined: 24 Sep 2004 Posts: 813 Location: Germany
|
Posted: Fri Mar 04, 2005 1:13 pm Post subject: |
|
|
| Pet Shop Boys? Elvis? |
|
| Back to top |
|
 |
Chris Site Admin
Joined: 02 Mar 2004 Posts: 10480
|
Posted: Fri Mar 04, 2005 9:47 pm Post subject: Re: Scrolling a control's content in pixel-steps |
|
|
| Tekl wrote: | | is it true that it is not possible to scroll a control pixel by pixel? | I don't know the answer, but it wouldn't surprise me if that were true.
If you haven't already, the following topic shows how to post the VSCROLL message directly to a control:
http://www.autohotkey.com/forum/viewtopic.php?t=136 |
|
| Back to top |
|
 |
Tekl
Joined: 24 Sep 2004 Posts: 813 Location: Germany
|
|
| Back to top |
|
 |
Chris Site Admin
Joined: 02 Mar 2004 Posts: 10480
|
Posted: Sun Mar 06, 2005 3:19 am Post subject: |
|
|
I read that post; based on it and the MSDN info I've read in the past, I doubt pixel scrolling is possible without overriding the control's WindowProc and substituting your own scrolling functions.
I believe the system provides the means to globally override all controls of a certain class (across the entire system). For example, it might be possible to write a program that alters all Edit controls to have pixel scroll capability. But the level of difficulty would likely be high. |
|
| Back to top |
|
 |
Tekl
Joined: 24 Sep 2004 Posts: 813 Location: Germany
|
Posted: Sun Mar 06, 2005 4:33 pm Post subject: |
|
|
Hi Chris,
so that's nothing for me. I've tried to examine how Opera will do it but without any success, maybe due to my limited knowledge about these messages.
Tekl |
|
| Back to top |
|
 |
Mythos
Joined: 29 Jan 2005 Posts: 22
|
Posted: Tue Mar 08, 2005 10:13 pm Post subject: Re: Scrolling a control's content in pixel-steps |
|
|
| Tekl wrote: | | is it true that it is not possible to scroll a control pixel by pixel? |
You can't scroll the content pixel by pixel but you still can position the scrollbar on pixel level straightly.
Try the following script with a small AutoHotkey help window (with visible h/v scrollbars of the content pane for any large help entry). The gesture is CTRL+LButton -> Drag.
We need the current scrollbar position to get it working properly. See http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/commctls/scrollbars/scrollbarreference/scrollbarmessages/sbm_getpos.asp for details.
| Code: |
#SingleInstance force
; [SCR] variable prefix
^LButton::
CoordMode, Mouse, Screen
MouseGetPos, SCR_MouseStartX, SCR_MouseStartY, SCR_WinID, SCR_ControlName
If ( !SCR_WinID )
Return
SetTimer, SCR_ScrollHandler, 10
Return
SCR_ScrollHandler:
CoordMode, Mouse, Screen
MouseGetPos, SCR_MouseX, SCR_MouseY
GetKeyState, SCR_LButtonState, LButton, P
GetKeyState, SCR_CtrlState, Ctrl, P
If ( (SCR_LButtonState = "U") or (SCR_CtrlState = "U") )
SetTimer, SCR_ScrollHandler, Off
Else
{
SCR_MouseDeltaX := SCR_MouseX - SCR_MouseStartX
SCR_MouseDeltaY := SCR_MouseY - SCR_MouseStartY
If ( SCR_MouseDeltaX < 0 )
{ ; 0x114 is WM_HSCROLL
SCR_wParam := (-SCR_MouseDeltaX << 16) | 4
SendMessage, 0x114, %SCR_wParam%, , %SCR_ControlName%, ahk_id %SCR_WinID%
}
If ( SCR_MouseDeltaY < 0 )
{ ; 0x115 is WM_VSCROLL
SCR_wParam := (-SCR_MouseDeltaY << 16) | 4
SendMessage, 0x115, %SCR_wParam%, , %SCR_ControlName%, ahk_id %SCR_WinID%
}
}
Return
|
Last edited by Mythos on Tue Mar 08, 2005 10:15 pm; edited 1 time in total |
|
| Back to top |
|
 |
Titan
Joined: 11 Aug 2004 Posts: 5390 Location: /b/
|
Posted: Tue Mar 08, 2005 10:15 pm Post subject: |
|
|
| toralf wrote: | Please BoBo,
I'm neither Titan nor Tekl. | Hmm, what's that implying...? _________________
 |
|
| Back to top |
|
 |
jonny
Joined: 13 Nov 2004 Posts: 3004 Location: Minnesota
|
Posted: Tue Mar 08, 2005 11:40 pm Post subject: |
|
|
| It seems to work on roughly half the controls I test it on, and some aren't as smooth. Still, great script, Mythos! |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|