Hallo, guten Tag.
Kann man eigentlich dieses Fenster mit Scollbalken darstellen:
Window 20,20-250,400
Ich finde dafür kein Style.
Danke.
Gruss
Hallo, guten Tag.
Kann man eigentlich dieses Fenster mit Scollbalken darstellen:
Window 20,20-250,400
Ich finde dafür kein Style.
Danke.
Gruss
Hallo!
Wenn du gerade an deiner Website arbeitest oder dein aktuelles Hosting überdenkst: Wir betreiben mit NetzLiving eine Hosting-Plattform, die speziell auf Performance, Sicherheit und einfache Verwaltung ausgelegt ist.
XProfan kennt leider keinen Stil für Fenster mir Scrollbars. Frabbing hatte da mal was in "Dlls, Includes, Units und Prozeduren" geschrieben, habe zwar den Beitrag wieder gefunden, aber der Code dazu ist irgendwo in den Weiten des Netzes verschwunden. Vielleicht liest er das hier mal (ist ja in letzter Zeit beruflich stark eingespannt und selten hier) und könnte das nochmal zugänglich machen.
Gruß Volkmar
Jup danke für deine Überprüfung.
Gruss
hab mal inzwischen was zusammengefrickelt, aber ich glaube, du hast was anderes vor, oder? Hier mal ne kleine Demo:
Window 20,20-250,400
Declare hsv&,hsh&,htx&,x%,y%
x% = 50
y% = 50
hsh& = @Create("HScroll",%hwnd,"",2,337,220,15)
hsv& = @Create("VScroll",%hwnd,"",225,2,15,350)
SetScrollRange hsh&,2,144 'x-pos scrollbereich
SetScrollRange hsv&,2,321 'y-pos scrollbereich
SetScrollPos hsh&,x%
SetScrollPos hsv&,y%
htx& = @Create("text",%hwnd,"scroll mich",x%,y%,80,15)
While 1
WaitInput
SetWindowPos htx&=GetScrollPos(hsh&),GetScrollPos(hsv&)
EndWhile
End
Alles anzeigen
äh, die x,y Varibalen machen hier nicht wirklich Sinn, so ist kürzer:
Window 20,20-250,400
Declare hsv&,hsh&,htx&
hsh& = @Create("HScroll",%hwnd,"",2,337,220,15)
hsv& = @Create("VScroll",%hwnd,"",225,2,15,350)
SetScrollRange hsh&,2,144 'x-pos scrollbereich
SetScrollRange hsv&,2,321 'y-pos scrollbereich
SetScrollPos hsh&,50
SetScrollPos hsv&,50
htx& = @Create("text",%hwnd,"scroll mich",50,50,80,15)
While 1
WaitInput
SetWindowPos htx&=GetScrollPos(hsh&),GetScrollPos(hsv&)
EndWhile
End
Alles anzeigen
Ja, Volkmar meinte wohl Franks area. Hier eine Beispiel
'
' (w) Frabbing für Paules-PC-Forum:
' http://www.paules-pc-forum.de/forum/xprofan/
'
$H windows.ph
$H messages.ph
Declare area_plus&, area_plus2&
Declare but1_plus&, but2_plus&, but3_plus&, but4_plus&, but21_plus&, but22_plus&, but23_plus&, but24_plus&
Declare x_plus&, last_plus&
$I an_area.inc = FA_
SubClassProc
FA_SubclassArea
EndProc
Cls ~GetSysColor(15)
~SetClassLong(%hwnd, ~GCL_STYLE, (~GetClassLong(%hwnd, ~GCL_STYLE)- ~CS_HREDRAW - ~CS_VREDRAW))
Usefont "MS Sans Serif",10,0,0,0,0
SetDialogFont 1
'
' Area 1 initieren
'
area_plus& = FA_CreateArea(800,800,$0,$50300000,8,8,240,400,%hwnd)
SubClass area_plus&, 1
'
' Area 2 initieren
'
area_plus2& = FA_CreateArea(800,800,$20000,$50300000,264,8,344,400,%hwnd)
SubClass area_plus2&, 1
'
' Testcontrols für Area 1
'
but1_plus&=Create("Button",area_plus&,"Testbutton 1",8 ,8 ,80,20)
but2_plus&=Create("Listbox",area_plus&,"Testbutton 2",200 ,52 ,200,60)
AddString(but2_plus&,"Testzeile 1")
AddString(but2_plus&,"Testzeile 2")
AddString(but2_plus&,"Testzeile 3")
AddString(but2_plus&,"Testzeile 4")
AddString(but2_plus&,"Testzeile 5")
but3_plus&=Control("MSCTLS_TRACKBAR32", "Trackbar01", $54000000, 100, 200, 200, 20, area_plus&, 2011, %hInstance, $00010004)
but4_plus&=Create("ChoiceBox", area_plus&, 1, 8, 300, 120, 80)
AddString(but4_plus&,"Testzeile 1")
AddString(but4_plus&,"Testzeile 2")
AddString(but4_plus&,"Testzeile 3")
AddString(but4_plus&,"Testzeile 4")
AddString(but4_plus&,"Testzeile 5")
'
' Testcontrol für Area 2
'
but21_plus&=Create("Button",area_plus2&,"Testbutton 1",80 ,8 ,80,20)
but22_plus&=Create("Listbox",area_plus2&,"Testbutton 2",400 ,52 ,200,60)
AddString(but22_plus&,"Testzeile 1")
AddString(but22_plus&,"Testzeile 2")
AddString(but22_plus&,"Testzeile 3")
AddString(but22_plus&,"Testzeile 4")
AddString(but22_plus&,"Testzeile 5")
but23_plus&=Control("MSCTLS_TRACKBAR32", "Trackbar01", $54000000, 300, 200, 200, 20, area_plus2&, 2011, %hInstance, $00010004)
but24_plus&=Create("ChoiceBox", area_plus2&, 1, 68, 300, 120, 80)
AddString(but24_plus&,"Testzeile 1")
AddString(but24_plus&,"Testzeile 2")
AddString(but24_plus&,"Testzeile 3")
AddString(but24_plus&,"Testzeile 4")
AddString(but24_plus&,"Testzeile 5")
While 1
WaitInput
Case %key=2:Break
If (Clicked(but1_plus&) or Clicked(but21_plus&))
SetText %hwnd,"Button 1 gedrückt"
ElseIf (Clicked(but2_plus&) or Clicked(but22_plus&))
SetText %hwnd,"Listbox gedrückt"
ElseIf (Clicked(but4_plus&) or Clicked(but24_plus&))
SetText %hwnd,"Choicebox gedrückt"
EndIf
If GetFocus(but3_plus&)
x_plus&=SendMessage(but3_plus&,$400,0,0)
If x_plus&<>last_plus&
last_plus&=x_plus&
SetText %hwnd,"Trackbar auf Position "+Str$(x_plus&)
EndIf
EndIf
If GetFocus(but23_plus&)
x_plus&=SendMessage(but23_plus&,$400,0,0)
If x_plus&<>last_plus&
last_plus&=x_plus&
SetText %hwnd,"Trackbar auf Position "+Str$(x_plus&)
EndIf
EndIf
Endwhile
SubClass area_plus&, 0
SubClass area_plus2&, 0
Dispose rect_plus#
Dispose vs_plus#
End
Alles anzeigen
und die inc
'
' (c) Frabbing für Paules-PC-Forum:
' http://www.paules-pc-forum.de/forum/xprofan/
'
$H windows.ph
$H messages.ph
Declare ?_a_plus&, ?_x_plus&, ?_y_plus&, ?_text$, ?_area_plus&, ?_area_plus2&, ?_klasse$, ?_last_plus&, ?_parent&
Declare ?_isx_plus&, ?_isy_plus&, ?_xx_plus!, ?_yy_plus!, ?_maxx_plus&, ?_maxy_plus&, ?_rect_plus#, ?_vs_plus#
Declare ?_virtx_plus&, ?_virty_plus&, ?_so_plus!, ?_but1_plus&, ?_but2_plus&, ?_but3_plus&, ?_but4_plus&, ?_but5_plus&
Dim ?_rect_plus#,16
Dim ?_vs_plus#,512
Clear ?_vs_plus#
Proc ?_CreateArea
Parameters ?_virtx&, ?_virty&, ?_wsex&, ?_ws&, ?_x&, ?_y&, ?_dx&, ?_dy&, ?_hwnd&
?_klasse$="#32770"
?_text$=""
?_area_plus&=~CreateWindowEx(?_wsex&,addr(?_klasse$),addr(?_text$),?_ws&,?_x& ,?_y& ,?_dx& ,?_dy& ,?_hwnd&,0,%hinstance,0)
?_virtx_plus&=?_virtx&
?_virty_plus&=?_virty&
~SetWindowLong(?_area_plus&,~GWL_ID,?_virtx&)
~SetWindowLong(?_area_plus&,~GWL_USERDATA,?_virty&)
~GetWindowRect(?_area_plus&,?_rect_plus#)
?_maxy_plus&=Long(?_rect_plus#,12)-Long(?_rect_plus#,4)+1
Long ?_vs_plus#,0=28
Long ?_vs_plus#,4=~SIF_ALL
Case ?_maxy_plus&+1>=?_virty_plus&:?_virty_plus&=?_maxy_plus&+1
Long ?_vs_plus#,12=?_virty_plus&
Long ?_vs_plus#,16=?_maxy_plus&
Long ?_vs_plus#,20=?_yy_plus!
~SetScrollInfo(?_area_plus&,~SB_VERT,?_vs_plus#,1)
?_maxx_plus&=Long(?_rect_plus#,8)-Long(?_rect_plus#,0)+1
Long ?_vs_plus#,0=28
Long ?_vs_plus#,4=~SIF_ALL
Case ?_maxx_plus&+1>=?_virtx_plus&:?_virtx_plus&=?_maxx_plus&+1
Long ?_vs_plus#,12=?_virtx_plus&
Long ?_vs_plus#,16=?_maxx_plus&
Long ?_vs_plus#,20=?_xx_plus!
~SetScrollInfo(?_area_plus&,~SB_HORZ,?_vs_plus#,1)
Return ?_area_plus&
EndProc
Proc ?_SubclassArea
?_x_plus&=~GetKeyState(1) & $8000
If ?_x_plus&
?_virtx_plus&=~GetWindowLong(&sWnd,~GWL_ID)
?_virty_plus&=~GetWindowLong(&sWnd,~GWL_USERDATA)
If (SubClassMessage(&sWnd, ~WM_VSCROLL) and (&sLParam=0))
~GetWindowRect(&sWnd,?_rect_plus#)
?_maxy_plus&=Long(?_rect_plus#,12)-Long(?_rect_plus#,4)+1
?_x_plus&=&sWParam & $0000ffff
?_a_plus&=1
If ?_x_plus&=~SB_LINEDOWN
?_isy_plus&=8
ElseIf ?_x_plus&=~SB_PAGEDOWN
?_isy_plus&=?_maxy_plus&
ElseIf ?_x_plus&=~SB_LINEUP
?_isy_plus&=-8
ElseIf ?_x_plus&=~SB_PAGEUP
?_isy_plus&=-?_maxy_plus&
ElseIf ?_x_plus&=~SB_THUMBTRACK
?_so_plus!=?_yy_plus!
?_yy_plus!=&sWParam >> 16
?_isy_plus&=-(?_so_plus!-?_yy_plus!)
?_a_plus&=0
EndIf
If ?_a_plus&
?_yy_plus!=?_yy_plus!+?_isy_plus&
If ?_yy_plus!<0
?_isy_plus&=(?_isy_plus&+(0-?_yy_plus!))
?_yy_plus!=0
EndIf
If ?_yy_plus!>(?_virty_plus&-?_maxy_plus&)
?_isy_plus&=?_isy_plus&-(?_yy_plus!-(?_virty_plus&-?_maxy_plus&))
?_yy_plus!=?_virty_plus&-?_maxy_plus&
EndIf
Endif
Long ?_vs_plus#,0=28
Long ?_vs_plus#,4=~SIF_ALL
If ?_maxy_plus&+1>=?_virty_plus&
?_virty_plus&=?_maxy_plus&+1
~ShowScrollBar(&sWnd,~SB_VERT,0)
Else
~ShowScrollBar(&sWnd,~SB_VERT,1)
Endif
Long ?_vs_plus#,12=?_virty_plus&
Long ?_vs_plus#,16=?_maxy_plus&+1
Long ?_vs_plus#,20=?_yy_plus!
~SetScrollInfo(&sWnd,~SB_VERT,?_vs_plus#,1)
~ScrollWindow(&sWnd,0,-?_isy_plus&,0,0)
~UpdateWindow(&sWnd)
ElseIf (SubClassMessage(&sWnd, ~WM_HSCROLL) and (&sLParam=0))
~GetWindowRect(&sWnd,?_rect_plus#)
?_maxx_plus&=Long(?_rect_plus#,8)-Long(?_rect_plus#,0)+1
?_x_plus&=&sWParam & $0000ffff
?_a_plus&=1
If ?_x_plus&=~SB_LINERIGHT
?_isx_plus&=8
ElseIf ?_x_plus&=~SB_PAGERIGHT
?_isx_plus&=?_maxx_plus&
ElseIf ?_x_plus&=~SB_LINELEFT
?_isx_plus&=-8
ElseIf ?_x_plus&=~SB_PAGELEFT
?_isx_plus&=-?_maxx_plus&
ElseIf ?_x_plus&=~SB_THUMBTRACK
?_so_plus!=?_xx_plus!
?_xx_plus!=&sWParam >> 16
?_isx_plus&=-(?_so_plus!-?_xx_plus!)
?_a_plus&=0
EndIf
If ?_a_plus&
?_xx_plus!=?_xx_plus!+?_isx_plus&
If ?_xx_plus!<0
?_isx_plus&=(?_isx_plus&+(0-?_xx_plus!))
?_xx_plus!=0
EndIf
If ?_xx_plus!>(?_virtx_plus&-?_maxx_plus&)
?_isx_plus&=?_isx_plus&-(?_xx_plus!-(?_virtx_plus&-?_maxx_plus&))
?_xx_plus!=?_virtx_plus&-?_maxx_plus&
EndIf
Endif
Long ?_vs_plus#,0=28
Long ?_vs_plus#,4= ~SIF_ALL
If ?_maxx_plus&+1>=?_virtx_plus&
?_virtx_plus&=?_maxx_plus&+1
~ShowScrollBar(&sWnd,~SB_HORZ,0)
Else
~ShowScrollBar(&sWnd,~SB_HORZ,1)
Endif
Long ?_vs_plus#,12=?_virtx_plus&
Long ?_vs_plus#,16=?_maxx_plus&+1
Long ?_vs_plus#,20=?_xx_plus!
~SetScrollInfo(&sWnd,~SB_HORZ,?_vs_plus#,1)
~ScrollWindow(&sWnd,-?_isx_plus&,0,0,0)
~UpdateWindow(&sWnd)
EndIf
EndIf
?_parent&=~GetParent(&sWnd)
Case %sMessage=~WM_COMMAND: SendMessage(?_parent&,%sMessage,&sWParam,&sLParam)
Case (SubClassMessage(&sWnd, ~WM_HSCROLL) and (&sLParam<>0)): SendMessage(?_parent&,%sMessage,&sWParam,&sLParam)
Case (SubClassMessage(&sWnd, ~WM_VSCROLL) and (&sLParam<>0)): SendMessage(?_parent&,%sMessage,&sWParam,&sLParam)
EndProc
Alles anzeigen
Könnte aber auch etwas Neueres hier geben.
Gruß Thomas
Ja genau, den suchte ich. War damals als Dateianhang an seinem Betrag, aber sowas gibt es ja nicht mehr. Schön, daß der Code wieder aufgetaucht ist ![]()
Gruß Volkmar
Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!