Scrollbar / Slider

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

Post Reply
User avatar
AUGE_OHR
Posts: 2093
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany

Scrollbar / Slider

Post by AUGE_OHR »

hi,

to navigate in my WMPlayer i need a Scrollbar or Slider.
there is no "extra" Scrollbar Control so i try to use Slider

Slider have ON CHANGE
when click on Slider-Shaft and move to new Position than ON CHANGE does "react"
when change Value of Slider this Way

Code: Select all

  nScroll := GetProperty( "Form_1", "oScroll", "VALUE" )
  nScroll += 10
  SetProperty( "Form_1", "oScroll", "VALUE", nScroll )
Slider-Shaft IS moving but ON CHANGE does NOT "react", why :?:

---

i found out when "press" Cursor-Key ON CHANGE will "react"
so i try

Code: Select all

   DoMethod( "Form_1", "oScroll", "Setfocus" )
   SENDKEY( VK_LEFT )
   SENDKEY( VK_RIGHT )
   SENDKEY( VK_UP )
   SENDKEY( VK_DOWN )
but none work like "real" Cursor-Key ... hm ... :(

how can i "activate" ON CHANGE :idea:
have fun
Jimmy
franco
Posts: 877
Joined: Sat Nov 02, 2013 5:42 am
DBs Used: DBF
Location: Canada

Re: Scrollbar / Slider

Post by franco »

Can you mouse click back in WMPlayer.
All The Best,
Franco
Canada
User avatar
AUGE_OHR
Posts: 2093
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany

Re: Scrollbar / Slider

Post by AUGE_OHR »

hi,

it seems to be "my Problem" ... :(

i have modify Demo
c:\hmg.3.4.4\SAMPLES\Controls\Slider\SLIDER_2\

to edit TEXTBOX to enter Value and it does move Slider. :D
so it is my Concept where something does not work

---

i do have
a.) running WMPlayer which change Position = Time -> change Slider Position
b.) move Slider Position -> change Play-Time

ad b.)
1.) press Slider-Shaft and move to new Position -> Play-Time change -> WORK
2.) use Cursor left / right and move to new Position -> Play-Time change -> WORK

3.) use Mouse Wheel -> Slider-Shaft is moving but Play-Time does NOT change
4.) DblClick on Slider -> Slider-Shaft "jump" to new Position but Play-Time does NOT change

ad 3 & 4.) if i then press Cursor left / right it will get new Position -> Play-Time change -> WORK
p.s. SENDKEY( VK_LEFT ) seems not to work to "simulate" it

i will try to make a Demo ...
have fun
Jimmy
franco
Posts: 877
Joined: Sat Nov 02, 2013 5:42 am
DBs Used: DBF
Location: Canada

Re: Scrollbar / Slider

Post by franco »

Don1 know if this is what you want. I changed function to try.

Code: Select all

Function Slider1_Change
***********************  I did not try             Form_1.Slider_1.Value = Form_1.Text_1.value in place of 9 then refresh
*   Local nValue := Form_1.Slider_1.Value
Form_1.Slider_1.Value := 9
Form_1.Slider_1.Refresh

 *  Form_1.TextBox_1.Value := Str(nValue,2)
Return Nil
All The Best,
Franco
Canada
franco
Posts: 877
Joined: Sat Nov 02, 2013 5:42 am
DBs Used: DBF
Location: Canada

Re: Scrollbar / Slider

Post by franco »

Also tried ;

Code: Select all

Function Slider1_Change

   Local nValue := Form_1.Slider_2.Value
  Form_1.TextBox_1.Value := Str(nValue,2)
Form_1.Slider_1.Value:= Form_1.Slider_2.value
Form_1.Slider_1.refresh

Return Nil
All The Best,
Franco
Canada
User avatar
AUGE_OHR
Posts: 2093
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany

Re: Scrollbar / Slider

Post by AUGE_OHR »

hi,

try Sample
c:\hmg.3.4.4\SAMPLES\Controls\Slider\SLIDER_2\

you can use Wheel to move Slider-Shaft but Value will not be update using Wheel.
how make Wheel "fire" ON CHANGE Event :idea:
have fun
Jimmy
User avatar
AUGE_OHR
Posts: 2093
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany

Re: Scrollbar / Slider

Post by AUGE_OHR »

hi,

got it :D

WHEEL is "by Design" and i have try to "catch" it this Way

Code: Select all

LOCAL nIndex
   CREATE EVENT PROCNAME Wheel_Move() HWND Form_1.HANDLE STOREINDEX nIndex

PROCEDURE Wheel_Move()
LOCAL nHWnd   := EventHWND()
LOCAL nMsg    := EventMSG()
LOCAL nWParam := EventWPARAM()
LOCAL nLParam := EventLPARAM()

   DO CASE
      CASE nMsg = WM_MOUSEWHEEL
         IF HiWord( nWParam ) == 120
            WheelNewPos( + 1 )
         ELSE
            WheelNewPos( - 1 )
         ENDIF
   ENDCASE
RETURN
but Slider does not react :o
so i try Handle of Slider

Code: Select all

CREATE EVENT PROCNAME Wheel_Move() HWND Form_1.Slider_1.HANDLE STOREINDEX nIndex
and that work :D

---

Demo Sample have many Slider. how make the Workaround for all Slider :idea:
SLIDER_2.ZIP
(1.23 KiB) Downloaded 99 times
have fun
Jimmy
franco
Posts: 877
Joined: Sat Nov 02, 2013 5:42 am
DBs Used: DBF
Location: Canada

Re: Scrollbar / Slider

Post by franco »

Nice work jimmy,
I must learn how to Create event
All The Best,
Franco
Canada
Post Reply