Hier eine komplette Version, einschließlich DoubleBuffering, mehr wird wohl nicht möglich sein:
$H Windows.ph
Set("AutoPaint", 0)
window 50,50-700,500
declare ReBar&,ReBar#,Lb1&,Lb2&,Lb3&,a#
dim a#,16
Lb1&=create("Gridbox",%hwnd,"F1;0;80;F2;0;80;F3;0;80",0,0,0,0,0)
SetStyle Lb1&, @GetStyle(Lb1&) | ~WS_CLIPCHILDREN
AddString(Lb1&, "AB|DEF|0123")
AddString(Lb1&, "GHI|J23KL|012345")
AddString(Lb1&, "*|MNOP|PQR|")
AddString(Lb1&, "STU||V")
Lb2&=create("listbox",%hwnd,"",0,0,0,0)
SetStyle Lb2&, @GetStyle(Lb2&) | ~WS_CLIPCHILDREN
clearlist
addfonts
movelisttolist(Lb2&)
Lb3&=create("Gridbox",%hwnd,"F1;0;80;F2;0;80;F3;23;80",0,0,0,0,0)
SetStyle Lb3&, @GetStyle(Lb3&) | ~WS_CLIPCHILDREN
AddString(Lb3&, "ABCD12|STUVW|XYZ0")
AddString(Lb3&, "ABCD34|stuvw|999,00")
AddString(Lb3&, "Abcd45|STUVW|-111,11")
clear a#
long a#,0=8
long a#,4=$FFFF'---Alles initialisieren
external("comctl32.dll","InitCommonControlsEx",a#)
' Stil: ~WS_CHILD | ~WS_VISIBLE | ~WS_CLIPSIBLINGS | ~WS_CLIPCHILDREN | ~CCS_NORESIZE | ~RBS_FIXEDORDER
'ReBar&=Control("ReBarWindow32","",$56000804 ,10,10,600,400,%hwnd,1,0)
'--Stil: $50000000 | ~CCS_NORESIZE | ~RBS_FIXEDORDER
ReBar&=Control("ReBarWindow32","",$56000804 ,10,10,600,400,%hwnd,1,0)
SetStyle 1, ReBar&, GetStyle(1, ReBar&) | $2000000 ' $2000000 = WS_EX_COMPOSITED (Double Buffer)
struct ReBar=Size&,Mask&,Style&,clrFore&,clrBack&,lpText&,cch&,iImage&,hwndChild&,\
cxMinChild&,cyMinChild&,cx&,hbmBack&,wID&,cyChild&,cyMaxChild&,cyIntegral&,\
cxIdeal&,lParam&,cxHeader&
dim ReBar#,ReBar'--REBARBANDINFO
clear ReBar#
with ReBar#
.Size&=sizeof(ReBar#)
.Mask&=$71'------RBBIM_STYLE | RBBIM_CHILD | RBBIM_CHILDSIZE | RBBIM_SIZE
.cyMaxChild&=1'--Darf nicht Null sein
.Style&=256'------------------------RBBS_NOGRIPPER (1. Band ohne Griff)
.cxMinChild&=5'---------------------Minimum Breite
.cyMinChild&=height(ReBar&)'--------Höhe des Bandes
.cx&=100'---------------------------Vorgabe Breite
.hwndChild&=Lb1&'-------------------Band 1
sendmessage(ReBar&,1025,0,ReBar#)'--RB_INSERTBAND
.Style&=128'------------------------RBBS_GRIPPERALWAYS (folgende Bänder mit Griff)
.cxMinChild&=50'--------------------Minimum Breite
.cyMinChild&=200'-------------------Höhe des Bandes
.cx&=300'---------------------------Vorgabe Breite
.hwndChild&=Lb2&'-------------------Band 2
sendmessage(ReBar&,1025,1,ReBar#)'--RB_INSERTBAND
.cxMinChild&=10'--------------------Minimum Breite
.cyMinChild&=300'-------------------Höhe des Bandes
.hwndChild&=Lb3&'-------------------Band 3
sendmessage(ReBar&,1025,2,ReBar#)'--RB_INSERTBAND
endwith
while 1
waitinput
if sendmessage(ReBar&,1051,0,0) > height(ReBar&)'--1051 = RB_GETBARHEIGHT
clear a#'--"Umklappen" rückgängig, falls Gripper nach unten gezogen wurde
sendmessage(ReBar&,1047,0,a#)'--RB_SIZETORECT
endif
endwhile
Alles anzeigen