English
Source / code snippets

Lautstärkeregler Scroll bar

 

CompileMarkSeparation
Source wurde am 15.07.2007 aus der MMJ-Quellcodesammlung (Dietmar Horn) in die Babyklappe auf XProfan.Com abgelegt:
Scrollbalken (z.B. für Lautstärkeregler)
Bei windows XP prof. funktioniert die Einstellung Balken ohne Kästchen seltsamerweise nicht
die Breite muss mindestens 10 sein, sonst wird bei xp garnichts angezeigt.
Def GetSysColor(1) !USER32,GetSysColor
SETTRUECOLOR 1
DECLARE ENDE%,PROGBAR&,plus&,minus&,fertig&,show&,volume&,target&,progstep!,TarStep!,handicap!
WINDOWSTYLE 528 bei anderem Windowstyle Doppelklick abfangen
WINDOWTITLE Lautstärke
WINDOW SUB(DIV(%MAXX,2),DIV(135,2)),SUB(DIV(%MAXY,2),DIV(251,2))-135,251
CLS GETSYSCOLOR(15)
USEFONT MS Sans Serif,13,0,0,0,0
SETDIALOGFONT 1
decimals 2
LET plus&=@CREATEBUTTON(%HWND,+,48,13,20,20)
let ProgBar&=@control(msctls_progress32,,$50800005,55,48,10,60,%Hwnd,1,%HInstance) =vertikal, $50000001=horizontal
LET minus&=@CREATEBUTTON(%HWND,-,48,124,20,20)
let show&=@CreateEdit(%Hwnd,,40,160,40,20)
enablewindow show&,0
LET fertig&=@CREATEBUTTON(%HWND,&Ende,3,190,120,25)
let target&=255 =100% Ziellautstärke
let Progstep!=5 =5% auf oder ab bei jedem Klick
let TarStep!=mul(div(target&,100),Progstep!) Progressbar und Lautstärke angleichen
Vorgabe, z.B. wenn man bisherige Lautstärke aus ini liest
let volume&=125 Wert muss natürlich zu dem Prozentwert passen

IFnot gt(volume&,target&) or lt(volume&,0) Falls Ini von Hand geändert wurde

    let handicap!=mul(div(100,target&),volume&) Vorgabe in Anzeige umrechnen

else

    handicap!=100
    let volume&=target&

endif

sendmessage(ProgBar&,$402,handicap!,0) auf Vorgabe setzten
settext show&,@str$(volume&)

WHILENOT ENDE%

    WAITINPUT

    If @EQU(%KEY,2)

        LET ENDE%= 1

    ELSEIF @GETFOCUS(plus&)

        sendmessage(ProgBar&,$403,progstep!,0)
        let volume&=volume&+TarStep!
        case equ(volume&,target&) or gt(volume&,target&):let volume&=target&
        settext show&,@str$(volume&)

    ELSEIF @GETFOCUS(minus&)

        Declare test$
        Let test$=@str$(Tarstep!)
        Let test$=right$(@Instr(.,test$),2)
        sendmessage(ProgBar&,$403,-ProgStep!,0)
        let volume&=volume&-TarStep!
        Case gt(val(test$),0):let volume&=Volume&+1 Korrektur bei Werten hinter dem Komma
        case equ(volume&,0) or lt(volume&,0):let volume&=0
        settext show&,@str$(volume&)

    ELSEIF @GETFOCUS(fertig&)

        let Ende%=1

    ENDIFclass=s4 href='./../../Function-References/XProfan/wend/'>WEND

 
07/16/07  
 




Michael
W.
Aufgefrischt, but since missing yet some. Window has z.B. only 3 values...
'Source watts on the 15.07.2007 from the MMJ-Quellcodesammlung (Dietmar horn) into Babyklappe on XProfan.com stored:
'Scroll bar (z.B. for Lautstärkeregler)
'with windows XP prof. functions The attitude beam without Kästchen seltsamerweise not
'The wide must at least 10 his, otherwise becomes with xp garnichts displayed.
Def GetSysColor(1) !USER32,GetSysColor
Set("TrueColor",1)
DECLARE ENDE%, PROGBAR&, plus&, minus&, fertig&, show&, volume&, target&, progstep!, TarStep!, handicap!
WINDOWSTYLE 528'with anderem Windowstyle Double click intercepting
WINDOWTITLE Volume
WINDOW SUB(DIV(%MAXX,2),DIV(135,2)),SUB(DIV(%MAXY,2),DIV(251,2))-135,251
CLS GETSYSCOLOR(15)
USEFONT "MS Sans Serif",13,0,0,0,0
SETDIALOGFONT 1
Set("Decimals",2)
plus& = Create("Button",%HWND,"+",48,13,20,20)
ProgBar& = control("msctls_progress32",,$50800005,55,48,10,60,%Hwnd,1,%HInstance)'=vertikal, $50000001=horizontal
minus& = Create("Button",%HWND,"-",48,124,20,20)
show& = Create("Edit",%Hwnd,,40,160,40,20)
enablewindow show&,0
fertig& = Create("Button",%HWND,&end,3,190,120,25)
target& = 255'=100% Ziellautstärke
Progstep! = 5'=5% on or ex each Click
TarStep! = target& / 100 * Progstep!'wallpaper.pcu of and volume equal
'default, z.B. if one previous Volume from ini reads
volume& = 125'worth must naturally to the Prozentwert fit

IFnot (volume& > target&) or (volume& < 0)'if Ini by hand changed watts

    handicap! = 100 / target& * volume&'default in display converting

else

    handicap! = 100
    volume& = target&

endif

sendmessage(ProgBar&,$402,handicap!,0)'on default settle
settext show&,st$(volume&)

WHILENOT ENDE%

    WAITINPUT

    If %KEY = 2

        ENDE% = 1

    ELSEIF GETFOCUS(plus&)

        sendmessage(ProgBar&,$403,progstep!,0)
        volume& = volume& + TarStep!
        case (volume& = target&) or (volume& > target&) : volume& = target&
        settext show&,st$(volume&)

    ELSEIF GETFOCUS(minus&)

        Declare Test$
        Test$ = st$(Tarstep!)
        Test$ = right$(Instr(".",Test$),2)
        sendmessage(ProgBar&, $403, -ProgStep!, 0)
        volume& = volume& - TarStep!
        Case (val(test $) > 0) : volume& = Volume& + 1'Korrektur with Values behind the comma
        case (volume& <= 0) : volume& = 0
        settext show&,st$(volume&)

    ELSEIF GETFOCUS(fertig&)

        end% = 1

    ENDIF

EndWhile

 
System: Windows 8/10, XProfan X4
Programmieren, das spannendste Detektivspiel der Welt.
04/30/16  
 




p.specht

Nochmal aufgefrischt. there at take off here any quotation marks vanish, have I tappt im dunkeln To § konvertiert. means Rückkonvertierung not forget!
greeting

'*** Scroll bar, z.B. for Lautstärkeregler ***
'The Source watts on the 15.07.2007 from the MMJ-Quellcodesammlung of Dietmar horn(+) into
'Program-Babyklappe on XProfan.com stored and of M.Wodrich on the 30.04.2016 aufgefrischt;
'2017-01 of P.woodpecker for XProfan 11.2a (32bit) under Win7-64 home SP1 run made.
Def GetSysColor(1) !§USER32§,§GetSysColor§:Set(§TrueColor§,1)
DECLARE ENDE%,PROGBAR&,plus&,minus&,fertig&,show&,volume&,target&,\
progstep!,TarStep!,handicap!,Test$,BarBreite&
WINDOWSTYLE 528 'with anderem Windowstyle Double click intercepting
WINDOWTITLE §strength§:WINDOW (%MAXX\2-135\2),(%MAXY\2-251\2) - 135,251
CLS GETSYSCOLOR(15):USEFONT §MS Sans Serif§,13,0,0,0,0:SETDIALOGFONT 1:Set(§Decimals§,2)

BarBreite&=18 '25 '10

ProgBar& = control(\
§msctls_progress32§,§§,$50800005,55-Barbreite&/3, 48,Barbreite&,60,%Hwnd,1,%HInstance)
' ^^^^ =vertikal, $50000001 = horizontal
minus& = Create(§Button§,%HWND,§-§,48,124,20,20)
plus& = Create(§Button§,%HWND,§+§,48,13,20,20)
show& = Create(§Edit§,%Hwnd,§§,40,160,40,20)
enablewindow show&,0

fertig& = Create(§Button§,%HWND,§&Ende§,1,194,40,25)

target& = 255 '=100% Ziellautstärke
Progstep! = 5 '=5% on or ex each Click
TarStep! = target& / 100 * Progstep! 'wallpaper.pcu of and volume equal
'default, z.B. if one previous Volume from ini reads:
volume& = 125 'worth must naturally to the Prozentwert fit
IFnot (volume& > target&) or (volume& < 0) 'Falls Ini von Hand geändert wurde
handicap! = 100 / target& * volume& 'Vorgabe in Anzeige umrechnen
else
handicap! = 100:volume& = target&
endif

sendmessage(ProgBar&,$402,handicap!,0) 'on default settle
settext show&,st$(volume&)

WHILENOT ENDE%
WAITINPUT
If %KEY = 2:ENDE% = 1
ELSEIF GETFOCUS(plus&)
sendmessage(ProgBar&,$403,progstep!,0)
volume& = volume& + TarStep!
case (volume& = target&) or (volume& > target&) : volume& = target&
settext show&,st$(volume&)

ELSEIF GETFOCUS(minus&)
Test$ = st$(Tarstep!)
Test$ = right$(Instr(§.§,Test$),2)
sendmessage(ProgBar&, $403, -ProgStep!, 0)
volume& = volume& - TarStep!
Case (val(Test$) > 0) : volume& = Volume& + 1'Korrektur with Values behind the comma
case (volume& <= 0) : volume& = 0
settext show&,st$(volume&)

ELSEIF GETFOCUS(fertig&):end% = 1
ENDIF
EndWhile
 
Computer: Gerät, daß es in Mikrosekunden erlaubt, 50.000 Fehler zu machen, zB 'daß' statt 'das'...
01/03/17  
 



Zum Quelltext


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

5.347 Views

Untitledvor 0 min.
Gast.081510/03/24
Member 862464105/12/24
H.Brill05/20/23
p.specht11/18/21
More...

Themeninformationen

this Topic has 3 subscriber:

p.specht (1x)
Michael W. (1x)
unbekannt (1x)


Admins  |  AGB  |  Applications  |  Authors  |  Chat  |  Privacy Policy  |  Download  |  Entrance  |  Help  |  Merchantportal  |  Imprint  |  Mart  |  Interfaces  |  SDK  |  Services  |  Games  |  Search  |  Support

One proposition all XProfan, The there's!


My XProfan
Private Messages
Own Storage Forum
Topics-Remember-List
Own Posts
Own Topics
Clipboard
Log off
 Deutsch English Français Español Italia
Translations

Privacy Policy


we use Cookies only as Session-Cookies because of the technical necessity and with us there no Cookies of Drittanbietern.

If you here on our Website click or navigate, stimmst You ours registration of Information in our Cookies on XProfan.Net To.

further Information To our Cookies and moreover, How You The control above keep, find You in ours nachfolgenden Datenschutzerklärung.


all rightDatenschutzerklärung
i want none Cookie