Foro | | | | - Página 1 - |
|  Jörg Sellmeyer | Wahrscheinlich überseh Yo grad algo total Banales pero yo bekomm no hin, el Höhe dieses Rebar-Controls a ändern. El Breite passt se sí wunderbar automáticamente a, aber el Dingen reagiert überhaupt no en SetWindowPos.
'$I Rebar.inc
'{ Rebar.inc:
$H Windows.ph
$H Messages.ph
$H commctrl.ph
Proc InitCommControls
Declarar cmctrl#
Dim cmctrl#,16
Claro cmctrl#
Largo cmctrl#,0=8' hiermit se el Rebar-Control aktiviert
Largo cmctrl#,4=$FFFF'---Alles inicializar
Externo("comctl32.dll","InitCommonControlsEx",cmctrl#)
Disponer cmctrl#
ENDPROC
struct RebarInfo=Size&,Mask&,Style&,clrFore&,clrBack&,lpText&,cch&,iImage&,hwndChild&,\
cxMinChild&,cyMinChild&,cx&,hbmBack&,wID&,cyChild&,cyMaxChild&,cyIntegral&,\
cxIdeal&,lParam&,cxHeader&
Declarar RebarInfo#
Dim RebarInfo#,RebarInfo
SubProc Crear.Rebar
Parámetros hParent&,Texto$,x%,y%,b%,h%,Orientation&
Case Orientation& = 1:Orientation& = $80'vertikales Rebar
With RebarInfo#
.Size& = SizeOf(RebarInfo#)
.Mask& = ~RBBIM_STYLE
EndWith
Volver Control(~REBARCLASSNAME,Texto$,$50000804 | Orientation& | ~RBS_DBLCLKTOGGLE | ~RBS_AUTOSIZE,x%,y%,b%,h%,hParent&,0,$60300)
ENDPROC
Crear("Container","Rebar")
SubProc Rebar.Add
Parámetros RB&,hwndChild&,cxMinChild&,cyMinChild&,cx&
Claro RebarInfo#
With RebarInfo#
.Size& = SizeOf(RebarInfo#)
.Mask& = ~RBBIM_STYLE | ~RBBIM_CHILD | ~RBBIM_CHILDSIZE | ~RBBIM_SIZE
.cxMinChild& = cxMinChild&
.cyMinChild& = cyMinChild&
.cx& = cx&' Voreinstellung para Breite,o. Höhe. Je después de Orientation&
.hwndChild& = hwndChild&
If SendMessage(RB&,~RB_GETBANDCOUNT,0,0) = 0
.Style&=~RBBS_NOGRIPPER | ~RBBS_CHILDEDGE
SendMessage(RB&,~RB_INSERTBANDA,0,RebarInfo#)
Más
.Style&=~RBBS_GRIPPERALWAYS | ~RBBS_CHILDEDGE
SendMessage(RB&,~RB_INSERTBANDA,-1,RebarInfo#)
'-1 = a letzter Punto anhängen
EndIf
EndWith
ENDPROC
'Rebar.inc Ende
'}
RBBIM_SIZE
SubClassProc
If SubClassMessage(%hWnd, ~wm_sizing)
Resize
Conjunto("WinProc", 0)
EndIf
ENDPROC
Proc Resize
SetWindowPos Rebar& = 0,0 - Width(%hwnd),(Height(%hwnd))
'SetWindowPos hList& = 0,0 - Width(hList&),(Height(Rebar&))
'SetWindowPos hEdit& = 0,0 - Width(hEdit&),(Height(Rebar&))
ENDPROC
Declarar hList&, hTV&,hEdit&
Ventana 800,600
Var Rebar& = Crear("Rebar",%hwnd,"",0,0,Width(%hwnd),Height(%hwnd),0)' si aquí como letztes 1 angegeben se, es el RebarControl vertikal
hList& = Crear("Listbox",%hwnd,0,0,0,0,0)
hEdit& = Crear("MultiEdit",%hwnd,"",0,0,0,0)
Rebar("Add",Rebar&,hList&,50,Height(Rebar&),Width(Rebar&) / 6)
Rebar("Add",Rebar&,hEdit&,50,Height(Rebar&),Width(Rebar&) / 8 * 6)
SubClass %HWnd, 1'SubClassing des Hauptfensters einschalten
SubClass Rebar&, 1'SubClassing des Rebar einschalten
Mientras que 1
WaitInput
If %Key = 4
Resize
SetWindowPos Rebar& = 0,0 - (Width(%hwnd)),(Height(%hwnd)-2)
EndIf
Wend
SubClass %HWnd, 0
SubClass Rebar&,0
|
| | | | |
|  | « Dieser Contribución wurde como Solución gekennzeichnet. » | |  Matthias Arlt |   Yo me de tiempo el Mühe gemacht y el Source algo umgebaut y bereinigt. Dafür war Yo gestern entonces doch a müde. Nun klappt el auch con TabControl y TreeView. Sogar sin FastMode. Jetzt kommen auch el Benachrichtigungen vom Rebar por.
'Rebar direkt en HWND
$H Windows.ph
$H Messages.ph
$H commctrl.ph
declarar rect#
dim rect#,16
proc InitCommCtrl
declarar icc#
dim icc#,16
long icc#,0=8
long icc#,4=$FFFF
external("comctl32.dll","InitCommonControlsEx",icc#)
disponer icc#
ENDPROC
InitCommCtrl
proc RebarBandInfo
parámetros Rebar&,msg&,num&,mask&,style&,child&
declarar Rebar#
style&=style&*128
dim Rebar#,80
long Rebar#,0=80
long Rebar#,4=mask&
long Rebar#,8=style&
long Rebar#,32=child&
long Rebar#,40=height(Rebar&) - 4
long Rebar#,44=width(child&,1) + 4
sendmessage(Rebar&,msg&,num&,Rebar#)
disponer Rebar#
ENDPROC
'{ SubClassProc:
SubClassProc
If SubClassMessage(%hWnd, 78)
If Largo(&slparam,0) = Rebar&
If (Largo(&slparam,8) = -839) or (Largo(&slparam,8) = -836)'RBN_CHILDSIZE oder RBN_ENDDRAG
Resize
Conjunto("WinProc", 1)
EndIf
ElseIf Largo(&slparam,0) = hTab&
If Largo(&slparam,8) = -551'TCN_SELCHANGE
Resize
Conjunto("WinProc", 1)
EndIf
EndIf
EndIf
ENDPROC
Proc Resize
Setwindowpos Rebar& = 0,0-width(%hwnd),height(%hwnd)
RebarBandInfo(Rebar&,1030,0,$71,2,hTab&)
RebarBandInfo(Rebar&,1030,1,$71,1,hEdit&)
clear rect#
caso GetActiveTab(hTab&)=0 : sendmessage(Rebar&,~RB_GETRECT,0,rect#)
SetWindowPos TV& = Largo(rect#,0),25 - (Largo(rect#,8) - 12),(Largo(rect#,12) - 29);1
ENDPROC
declarar Rebar&,hList&,hEdit&,TV&,TVR1&,hDlg&,hTab&
Declarar ActiveTab%,OldTab%
cls
'{ Rebarelemente:
hDlg& = Control("DIÁLOGO","",$54000000,2,25,180,0,%hwnd,0,%hInstance)
hEdit&=create("MultiEdit",%hwnd,"",0,0,0,0)
'}
'{ Rebar:
ReBar&=Control("ReBarWindow32","",$50000804,0,0,width(%hwnd),height(%hwnd),%hwnd,1,0)
RebarBandInfo(Rebar&,~RB_INSERTBANDA,0,$71,2,hDlg&)
RebarBandInfo(Rebar&,~RB_INSERTBANDA,1,$71,1,hEdit&)
'}
'{ TabCtrl:
hTab& = Crear("TabCtrl",hDlg&,"Test 3",0,0,180,0)
InsertTab(hTab&,0,"Test 2")
InsertTab(hTab&,0,"Test 1")
SendMessage(hTab&,~TCM_SETCURSEL,0,0)
'}
sendmessage(Rebar&,~RB_GETRECT,0,rect#)
SetWindowPos hDlg& = Largo(rect#,0),Largo(rect#,4),Largo(rect#,8),Largo(rect#,12);1
SetWindowPos hTab& = 0,0 - Width(hDlg&),Height(hDlg&);1
'{ Treeview:
TV& = Crear("TreeView",hTab&,0,2,25,(Width(hTab&) - 6),(Height(hTab&) - 29))
WhileLoop 3
TVR1& = TreeView("InsertItem",TV&,0,0,"Root " + Str$(&Loop))
TreeView("SetChildren", TV&,TVR1&, 1)
WhileLoop 5
TreeView("InsertItem",TV&,TVR1&,0,"Eintrag " +Str$(&Loop))
Wend
TreeView("Expand", TV&, TVR1&, 3)
Wend
'}
'Hauptsachleife:
'set("FASTMODE",1)
SubClass %HWnd, 1
Resize
mientras que 1
waitinput
caso %key = 4 : Resize
wend
Und el Hauptschleife es en una vez gaaanz schlank... |
| | | WinXP SP2, Win7 - XProfan 10/11/FreeProfan32 - Xpia | 20.06.2020 ▲ |
| |  |
| |  Matthias Arlt | Es con RB_SETBANDINFO. El gleiche REBARBANDINFO-Struktur senden, separat para cada Band y en .cyMinChild&=height(hwnd&) para el Höhe y .cx&=width(hwndChild&) para el Breite einsetzen. Jeweils después de el 'SetWindowPos Rebar&...' Das SubClassing es dafür ggf. entbehrlich. |
| | | WinXP SP2, Win7 - XProfan 10/11/FreeProfan32 - Xpia | 16.06.2020 ▲ |
| |
| |  Jörg Sellmeyer | Gracias, algo como tener Yo befürchtet. Dieses Strukturgeschiebe voluntad iwie nie así correcto en media Kopf rein. Das Subclassing tener Yo veces ausgeschaltet y lo kommen tatsächlich trotzdem Ergebnisse. Aunque no, como gewünscht. El Liste en el linken Página ändert ihre Größe, si ellos se auch no a el Größe des Rebars adaptar voluntad  Das Multiedit reagiert desafortunadamente nada en el Aufruf de Rebar("Resize",...) Tal vez dieses Rebar en efecto gar njicht wirklich pensamiento para esta Einsatz. Nach allem, Yo así gelesen habe, se lo más como Toolbar eingesetzt, y no así muy, en el Ventana a strukturieren.
'$I Rebar.inc
'{ Rebar.inc:
$H Windows.ph
$H Messages.ph
$H commctrl.ph
Proc InitCommControls
Declarar cmctrl#
Dim cmctrl#,16
Claro cmctrl#
Largo cmctrl#,0=8' hiermit se el Rebar-Control aktiviert
Largo cmctrl#,4=$FFFF'---Alles inicializar
Externo("comctl32.dll","InitCommonControlsEx",cmctrl#)
Disponer cmctrl#
ENDPROC
struct RebarInfo=Size&,Mask&,Style&,clrFore&,clrBack&,lpText&,cch&,iImage&,hwndChild&,\
cxMinChild&,cyMinChild&,cx&,hbmBack&,wID&,cyChild&,cyMaxChild&,cyIntegral&,\
cxIdeal&,lParam&,cxHeader&
Declarar RebarInfo#
Dim RebarInfo#,RebarInfo
SubProc Crear.Rebar
Parámetros hParent&,Texto$,x%,y%,b%,h%,Orientation&
Case Orientation& = 1:Orientation& = $80'vertikales Rebar
With RebarInfo#
.Size& = SizeOf(RebarInfo#)
.Mask& = ~RBBIM_STYLE
EndWith
Volver Control(~REBARCLASSNAME,Texto$,$50000804 | Orientation& | ~RBS_DBLCLKTOGGLE | ~RBS_AUTOSIZE | ~RBBS_CHILDEDGE,x%,y%,b%,h%,hParent&,0,$60300)
ENDPROC
Crear("Container","Rebar")
SubProc Rebar.Resize
Parámetros RB&,hwndChild&,cyMinChild&,cx&
Claro RebarInfo#
With RebarInfo#
.Size& = SizeOf(RebarInfo#)
.Mask& = ~RBBIM_CHILDSIZE
.cyMinChild& = cyMinChild&
.cx& = cx&
.hwndChild& = hwndChild&
SendMessage(RB&,~RB_SETBANDINFO,0,RebarInfo#)
EndWith
ENDPROC
SubProc Rebar.Add
Parámetros RB&,hwndChild&,cxMinChild&,cyMinChild&,cx&
Claro RebarInfo#
With RebarInfo#
.Size& = SizeOf(RebarInfo#)
.Mask& = ~RBBIM_STYLE | ~RBBIM_CHILD | ~RBBIM_CHILDSIZE | ~RBBIM_SIZE
.cxMinChild& = cxMinChild&
.cyMinChild& = cyMinChild&
.cx& = cx&' Voreinstellung para Breite,o. Höhe. Je después de Orientation&
.hwndChild& = hwndChild&
If SendMessage(RB&,~RB_GETBANDCOUNT,0,0) = 0
.Style&=~RBBS_NOGRIPPER | ~RBBS_CHILDEDGE
SendMessage(RB&,~RB_INSERTBANDA,0,RebarInfo#)
Más
.Style&=~RBBS_GRIPPERALWAYS | ~RBBS_CHILDEDGE
SendMessage(RB&,~RB_INSERTBANDA,-1,RebarInfo#)
'-1 = a letzter Punto anhängen
EndIf
EndWith
ENDPROC
'Rebar.inc Ende
'}
SubClassProc
If SubClassMessage(%hWnd, ~wm_sizing)
Resize
Conjunto("WinProc", 0)
EndIf
ENDPROC
Proc Resize
SetWindowPos Rebar& = 0,0 - Width(%hwnd),(Height(%hwnd))
Rebar("Resize",Rebar&,hList&,Height(Rebar&),Width(hList&))
Rebar("Resize",Rebar&,hEdit&,Height(Rebar&),Width(hEdit&))
ENDPROC
Declarar hList&, hTV&,hEdit&
Ventana 800,600
Var Rebar& = Crear("Rebar",%hwnd,"",0,0,Width(%hwnd),Height(%hwnd),0)' si aquí como letztes 1 angegeben se, es el RebarControl vertikal
hList& = Crear("Listbox",%hwnd,0,0,0,0,0)
hEdit& = Crear("MultiEdit",%hwnd,"",0,0,0,0)
Rebar("Add",Rebar&,hList&,50,Height(Rebar&)-10,Width(Rebar&) / 6)
Rebar("Add",Rebar&,hEdit&,50,Height(Rebar&),Width(Rebar&) / 8 * 6)
SubClass %HWnd, 0'SubClassing des Hauptfensters einschalten
SubClass Rebar&, 0'SubClassing des Rebar einschalten
Mientras que 1
WaitInput
If %Key = 4
Resize
SetWindowPos Rebar& = 0,0 - (Width(%hwnd)),(Height(%hwnd))
EndIf
Wend
SubClass %HWnd, 0
SubClass Rebar&,0
|
| | | | |
| |  Matthias Arlt | So debería lo ir. Como FreeProfan Su código no mochte, tener Yo el veces umgeschrieben. So es auch kompakter.
proc InitCommCtrl
declarar icc#
dim icc#,16
long icc#,0=8
long icc#,4=$FFFF
external("comctl32.dll","InitCommonControlsEx",icc#)
disponer icc#
ENDPROC
InitCommCtrl
proc RebarBandInfo
parámetros Rebar&,msg&,num&,mask&,style&,child&
declarar Rebar#
dim Rebar#,80
long Rebar#,0=80
long Rebar#,4=mask&
long Rebar#,8=style&
long Rebar#,32=child&
long Rebar#,40=height(Rebar&)
long Rebar#,44=width(child&)
sendmessage(Rebar&,msg&,num&,Rebar#)
disponer Rebar#
ENDPROC
declarar Rebar&,hList&,hEdit&
cls
hList&=create("Listbox",%hwnd,"",0,0,100,0)
hEdit&=create("MultiEdit",%hwnd,"",0,0,0,0)
ReBar&=Control("ReBarWindow32","",$50000804,0,0,width(%hwnd),height(%hwnd),%hwnd,1,0)
RebarBandInfo(Rebar&,1025,0,$71,256,hList&)
RebarBandInfo(Rebar&,1025,1,$71,128,hEdit&)
mientras que 1
waitinput
setwindowpos Rebar& = 0,0-width(%hwnd),height(%hwnd)
RebarBandInfo(Rebar&,1030,0,$71,256,hList&)
RebarBandInfo(Rebar&,1030,1,$71,128,hEdit&)
wend
|
| | | WinXP SP2, Win7 - XProfan 10/11/FreeProfan32 - Xpia | 16.06.2020 ▲ |
| |
| |  Matthias Arlt | Und qué el "Strukturgeschiebe" angeht...así schlimm es el nada. El komplette Struktur es sólo el je después de Control siempre igual aufgebaute Block a Informationen, el el Control para Erscheinungsbild y Función braucht. El Infos posición auch i.d.R. siempre a gleicher Punto en el Block. Yo muß also je Aufruf siempre sólo el Stellen en el Block escribir, que geändert haben oder para mich de Interesse son. Um en unserem Ejemplo a bleiben:
Yo müßte después de el Größenänderung eigentlich sólo el Stellen para height() y width() con el Message RB_SETBANDINFO senden, porque el übrigen en el Block enthaltenen Infos haben se sí no geändert. Das Control ha ellos sí ya. Lo schadet aber auch no, si yo mask, style, child usw. erneut auch con sende. Yo spare me en diesem Fall una zweite Proc y kann para Erzeugung (RB_INSERTBAND) y Resizing (RB_SETBANDINFO) una y el selbe uso. |
| | | WinXP SP2, Win7 - XProfan 10/11/FreeProfan32 - Xpia | 16.06.2020 ▲ |
| |
| |  Jörg Sellmeyer | Gracias! Sombrero mich ahora algo Grübelarbeit gekostet, porque Yo deinen Code primero otra vez traducir y verstehen musste, como du z. B. Messagenummern, anstelle el commctrl-Bezeichner nimmst. Und Yo quería sí wissen, wo en mi Code el Fehler es. Letztlich war lo entonces sólo el fehlende Indexnummer, el media Code ausgebremst ha. El Se me había olvidado anzupassen. sendmessage(Rebar&,msg&,num&,Rebar#) |
| | | | |
| |  Jörg Sellmeyer | Como bekomme Yo porque ahora con, si mittels des Rebar-Anfassers el Controls verändert voluntad? Yo una Tabcontrol en una Band y como wiederum mehrere Controls en él. Welche Message muss Yo überwachen, a Größenänderung entonces auch anzuwenden. Das Tabcontrol passt se sí automáticamente a aber el daraufliegenden Controls natürlich no. |
| | | Windows XP SP2 XProfan X4... und hier mal was ganz anderes als Profan ...  | 17.06.2020 ▲ |
| |
| |  Matthias Arlt | El einfachste Möglichkeit wäre, después de el 'waitinput' el Msg RB_GETRECT a senden:
dim rect#,16 sendmessage(Rebar&,1033,BandNum&,rect#)
El aktuellen Koordinaten des interessierenden Bands posición entonces en rect# a más Verwendung. |
| | | WinXP SP2, Win7 - XProfan 10/11/FreeProfan32 - Xpia | 17.06.2020 ▲ |
| |
| |  Jörg Sellmeyer | Das WaitInput se sólo no durchbrochen, si al Band "zieht". Das heißt, el Band + Child voluntad korrekt adaptado, während el daraufliegende Trieview se no ändert. Erst una Clic oder Tastendruck se el adaptado. |
| | | | |
| |  Matthias Arlt | Dann wirst Usted a dieser Punto doch en Subclassing zurückgreifen necesario:
|
| | | WinXP SP2, Win7 - XProfan 10/11/FreeProfan32 - Xpia | 17.06.2020 ▲ |
| |
| |  Jörg Sellmeyer | Yo bekomme no hin. Profano empfängt de el Rebar no Messages, scheint lo me.
Yo veces zwei Codevarianten erstellt. Einmal tener Yo el Rebar-Control direkt aufs Ventana principal gepappt, como blockiert el Programa, si yo el Subclass-Rutina einbaue. Zweitens liegt el Rebar-Control en una Diálogo-Static. Como se ejecuta el Programa zwar más pero voluntad no Messages ausgelöst, el el Subclassing aktivieren. Hilfreich wäre lo wahrscheinlich, si Profano como el Notify-Messages empfangen sería aber el Rebar leitet nichts su a Profano más, o Profano empfängt el no 
Lo son una Reihe de Notify-Messages, el genau passend dafür wären. ZB:
RBN_CHILDSIZE Sent by a rebar control when a band's child window is resized. This notification code is sent en the form of a WM_NOTIFY mensaje. [...] 
'Rebar direkt en HWND
$H Windows.ph
$H Messages.ph
$H commctrl.ph
declarar rect#
dim rect#,16
proc InitCommCtrl
declarar icc#
dim icc#,16
long icc#,0=8
long icc#,4=$FFFF
external("comctl32.dll","InitCommonControlsEx",icc#)
disponer icc#
ENDPROC
InitCommCtrl
proc RebarBandInfo
parámetros Rebar&,msg&,num&,mask&,style&,child&
declarar Rebar#,wnd&
wnd&=external("USER32","GetParent",Rebar&)
style&=style&*128
dim Rebar#,80
long Rebar#,0=80
long Rebar#,4=mask&
long Rebar#,8=style&
long Rebar#,32=child&
long Rebar#,40=height(wnd&) - 4
long Rebar#,44=width(child&,1) + 4
sendmessage(Rebar&,msg&,num&,Rebar#)
disponer Rebar#
ENDPROC
'{ SubClassProc:
SubClassProc
If SubClassMessage(%hWnd, 78)
If Largo(&slparam,0) = Rebar&
'hier RB_GETRECT senden
'sendmessage(Rebar&,1033,0,rect#)
Resize
EndIf
Conjunto("WinProc", 0)
EndIf
ENDPROC
Proc Resize
Claro rect#
Setwindowpos Rebar& = 0,0-width(%hwnd),height(%hwnd)
RebarBandInfo(Rebar&,1030,0,$71,2,hTab&)
RebarBandInfo(Rebar&,1030,1,$71,1,hEdit&)
sendmessage(Rebar&,~RB_GETRECT,0,rect#)
SetWindowPos TV& = Largo(rect#,0),25 - (Largo(rect#,8) - 12),(Largo(rect#,12) - 29)';1
ENDPROC
declarar Rebar&,hList&,hEdit&,TV&,TVR1&,hDlg&,hTab&
Declarar ActiveTab%,OldTab%
cls
'{ Rebarelemente:
hDlg& = Control("DIÁLOGO","",$54000000,2,25,180,0,%hwnd,0,%hInstance)
hEdit&=create("MultiEdit",%hwnd,"",0,0,0,0)
'}
'{ Rebar:
ReBar&=Control("ReBarWindow32","",$50000804,0,0,width(%hwnd),height(%hwnd),%hwnd,1,0)
RebarBandInfo(Rebar&,~RB_INSERTBANDA,0,$71,2,hDlg&)
RebarBandInfo(Rebar&,~RB_INSERTBANDA,1,$71,1,hEdit&)
'}
'{ TabCtrl:
hTab& = Crear("TabCtrl",hDlg&,"Test 3",0,0,180,0)
InsertTab(hTab&,0,"Test 2")
InsertTab(hTab&,0,"Test 1")
SendMessage(hTab&,~TCM_SETCURSEL,0,0)
'}
sendmessage(Rebar&,~RB_GETRECT,0,rect#)
SetWindowPos hDlg& = Largo(rect#,0),Largo(rect#,4),Largo(rect#,8),Largo(rect#,12);1
SetWindowPos hTab& = 0,0 - Width(hDlg&),Height(hDlg&);1
'{ Treeview:
TV& = Crear("TreeView",hTab&,0,2,25,(Width(hTab&) - 6),(Height(hTab&) - 29))
WhileLoop 3
TVR1& = TreeView("InsertItem",TV&,0,0,"Root " + Str$(&Loop))
TreeView("SetChildren", TV&,TVR1&, 1)
WhileLoop 5
TreeView("InsertItem",TV&,TVR1&,0,"Eintrag " +Str$(&Loop))
Wend
TreeView("Expand", TV&, TVR1&, 3)
Wend
'}
SubClass %HWnd, 1
'Hauptsachleife:
mientras que 1
waitinput
Título de la ventana Str$(&NotifyWnd) + " " + Str$(Rebar&) + " " + Str$(%notifycode)
ActiveTab% = GetActiveTab(hTab&)
If OldTab% <> ActiveTab%
ShowWindow(Tv&,ActiveTab% = 0)
ActiveTab% = GetActiveTab(hTab&)
If (ActiveTab% = 0)' and GetFocus(Rebar&)
Resize
' SendMessage(hTab&,~TCM_SETCURSEL,0,0)
EndIf
EndIf
If %key = 4
Resize
EndIf
OldTab% = GetActiveTab(hTab&)
wend
SubClass %HWnd, 0
'Rebar en el diálogo-Static
$H Windows.ph
$H Messages.ph
$H commctrl.ph
declarar rect#
dim rect#,16
proc InitCommCtrl
declarar icc#
dim icc#,16
long icc#,0=8
long icc#,4=$FFFF
external("comctl32.dll","InitCommonControlsEx",icc#)
disponer icc#
ENDPROC
InitCommCtrl
proc RebarBandInfo
parámetros Rebar&,msg&,num&,mask&,style&,child&
declarar Rebar#,wnd&
wnd&=external("USER32","GetParent",Rebar&)
style&=style&*128
dim Rebar#,80
long Rebar#,0=80
long Rebar#,4=mask&
long Rebar#,8=style&
long Rebar#,32=child&
long Rebar#,40=height(wnd&) - 4
long Rebar#,44=width(child&,1) + 4
sendmessage(Rebar&,msg&,num&,Rebar#)
disponer Rebar#
ENDPROC
'{ SubClassProc:
SubClassProc
If SubClassMessage(%hWnd, 78)
If Largo(&slparam,0) = Rebar&
'hier RB_GETRECT senden
'sendmessage(Rebar&,1033,0,rect#)
Resize
EndIf
Conjunto("WinProc", 0)
EndIf
ENDPROC
Proc Resize
setwindowpos hRBDlg& = 0,0-width(%hwnd),height(%hwnd)
Claro rect#
setwindowpos Rebar& = 0,0-width(hRBDlg&),height(hRBDlg&)
RebarBandInfo(Rebar&,1030,0,$71,2,hTab&)
RebarBandInfo(Rebar&,1030,1,$71,1,hEdit&)
sendmessage(Rebar&,~RB_GETRECT,0,rect#)
SetWindowPos TV& = Largo(rect#,0),25 - (Largo(rect#,8) - 12),(Largo(rect#,12) - 29)';1
ENDPROC
declarar Rebar&,hList&,hEdit&,TV&,TVR1&,hDlg&,hTab&
Declarar ActiveTab%,OldTab%
cls
'{ Rebarelemente:
hDlg& = Control("DIÁLOGO","",$54000000,2,25,180,0,%hwnd,0,%hInstance)
hEdit&=create("MultiEdit",%hwnd,"",0,0,0,0)
'}
'{ Rebar:
Var hRBDlg& = Control("DIÁLOGO","",$54000000,0,0,Width(%hwnd),Height(%hwnd),%hwnd,0,%hInstance)
ReBar&=Control("ReBarWindow32","",$50000804,0,0,width(hRBDlg&),height(hRBDlg&),hRBDlg&,1,0)
RebarBandInfo(Rebar&,~RB_INSERTBANDA,0,$71,2,hDlg&)
RebarBandInfo(Rebar&,~RB_INSERTBANDA,1,$71,1,hEdit&)
'}
'{ TabCtrl:
hTab& = Crear("TabCtrl",hDlg&,"Test 3",0,0,180,0)
InsertTab(hTab&,0,"Test 2")
InsertTab(hTab&,0,"Test 1")
SendMessage(hTab&,~TCM_SETCURSEL,0,0)
'}
sendmessage(Rebar&,~RB_GETRECT,0,rect#)
SetWindowPos hDlg& = Largo(rect#,0),Largo(rect#,4),Largo(rect#,8),Largo(rect#,12);1
SetWindowPos hTab& = 0,0 - Width(hDlg&),Height(hDlg&);1
'{ Treeview:
TV& = Crear("TreeView",hTab&,0,2,25,(Width(hTab&) - 6),(Height(hTab&) - 29))
WhileLoop 3
TVR1& = TreeView("InsertItem",TV&,0,0,"Root " + Str$(&Loop))
TreeView("SetChildren", TV&,TVR1&, 1)
WhileLoop 5
TreeView("InsertItem",TV&,TVR1&,0,"Eintrag " +Str$(&Loop))
Wend
TreeView("Expand", TV&, TVR1&, 3)
Wend
'}
SubClass %HWnd, 1
'Hauptsachleife:
mientras que 1
waitinput
Título de la ventana Str$(&NotifyWnd) + " " + Str$(Rebar&) + " " + Str$(%notifycode)
ActiveTab% = GetActiveTab(hTab&)
If OldTab% <> ActiveTab%
ShowWindow(Tv&,ActiveTab% = 0)
ActiveTab% = GetActiveTab(hTab&)
If (ActiveTab% = 0)
Resize
EndIf
EndIf
If %key = 4
Resize
EndIf
OldTab% = GetActiveTab(hTab&)
wend
SubClass %HWnd, 0
SubClass Rebar&, 0
|
| | | Windows XP SP2 XProfan X4... und hier mal was ganz anderes als Profan ...  | 19.06.2020 ▲ |
| |
| |  Matthias Arlt | Nach unos pocos pequeño Los cambios se ejecuta lo en me (bajo 11.2 y FreeProfan32):
'Rebar direkt en HWND
$H Windows.ph
$H Messages.ph
$H commctrl.ph
declarar rect#
dim rect#,16
proc InitCommCtrl
declarar icc#
dim icc#,16
long icc#,0=8
long icc#,4=$FFFF
external("comctl32.dll","InitCommonControlsEx",icc#)
disponer icc#
ENDPROC
InitCommCtrl
proc RebarBandInfo
parámetros Rebar&,msg&,num&,mask&,style&,child&
declarar Rebar#
style&=style&*128
dim Rebar#,80
long Rebar#,0=80
long Rebar#,4=mask&
long Rebar#,8=style&
long Rebar#,32=child&
long Rebar#,40=height(Rebar&) - 4
long Rebar#,44=width(child&,1) + 4
sendmessage(Rebar&,msg&,num&,Rebar#)
disponer Rebar#
ENDPROC
'{ SubClassProc:
SubClassProc
If SubClassMessage(%hWnd, 78)
If Largo(&slparam,0) = Rebar&
If Largo(&slparam,8) = -14'NM_NCHITTEST
Resize
Conjunto("WinProc", 1)
EndIf
EndIf
EndIf
ENDPROC
Proc Resize
Claro rect#
Setwindowpos Rebar& = 0,0-width(%hwnd),height(%hwnd)
RebarBandInfo(Rebar&,1030,0,$71,2,hTab&)
RebarBandInfo(Rebar&,1030,1,$71,1,hEdit&)
sendmessage(Rebar&,~RB_GETRECT,0,rect#)
SetWindowPos TV& = Largo(rect#,0),25 - (Largo(rect#,8) - 12),(Largo(rect#,12) - 29);1
ENDPROC
declarar Rebar&,hList&,hEdit&,TV&,TVR1&,hDlg&,hTab&
Declarar ActiveTab%,OldTab%
cls
'{ Rebarelemente:
hDlg& = Control("DIÁLOGO","",$54000000,2,25,180,0,%hwnd,0,%hInstance)
hEdit&=create("MultiEdit",%hwnd,"",0,0,0,0)
'}
'{ Rebar:
ReBar&=Control("ReBarWindow32","",$50000804,0,0,width(%hwnd),height(%hwnd),%hwnd,1,0)
RebarBandInfo(Rebar&,~RB_INSERTBANDA,0,$71,2,hDlg&)
RebarBandInfo(Rebar&,~RB_INSERTBANDA,1,$71,1,hEdit&)
'}
'{ TabCtrl:
hTab& = Crear("TabCtrl",hDlg&,"Test 3",0,0,180,0)
InsertTab(hTab&,0,"Test 2")
InsertTab(hTab&,0,"Test 1")
SendMessage(hTab&,~TCM_SETCURSEL,0,0)
'}
sendmessage(Rebar&,~RB_GETRECT,0,rect#)
SetWindowPos hDlg& = Largo(rect#,0),Largo(rect#,4),Largo(rect#,8),Largo(rect#,12);1
SetWindowPos hTab& = 0,0 - Width(hDlg&),Height(hDlg&);1
'{ Treeview:
TV& = Crear("TreeView",hTab&,0,2,25,(Width(hTab&) - 6),(Height(hTab&) - 29))
WhileLoop 3
TVR1& = TreeView("InsertItem",TV&,0,0,"Root " + Str$(&Loop))
TreeView("SetChildren", TV&,TVR1&, 1)
WhileLoop 5
TreeView("InsertItem",TV&,TVR1&,0,"Eintrag " +Str$(&Loop))
Wend
TreeView("Expand", TV&, TVR1&, 3)
Wend
'}
'Hauptsachleife:
SubClass %HWnd, 1
mientras que 1
waitinput
Resize
Título de la ventana Str$(&NotifyWnd) + " " + Str$(Rebar&) + " " + Str$(%notifycode)
ActiveTab% = GetActiveTab(hTab&)
If OldTab% <> ActiveTab%
ShowWindow(Tv&,ActiveTab% = 0)
ActiveTab% = GetActiveTab(hTab&)
If (ActiveTab% = 0)' and GetFocus(Rebar&)
Resize
'SendMessage(hTab&,~TCM_SETCURSEL,0,0)
EndIf
EndIf
If %key = 4
Resize
EndIf
OldTab% = GetActiveTab(hTab&)
wend
SubClass %HWnd, 0
Ein weiteres Resize después de el WaitInput war notwendig y el Auswertung de NM_NCHITTEST en el SubClassing. Eleganter wäre RBN_ENDDRAG gewesen, dringt aber hay no por. Yo denke, así va el sicher auch...
Apéndice: Mit el gleichen Los cambios se ejecuta lo auch con el Diálogo como Parent. Das SubClassing muß entonces natürlich para el Diálogo tener lugar, en lugar de para %HWND. |
| | | WinXP SP2, Win7 - XProfan 10/11/FreeProfan32 - Xpia | 19.06.2020 ▲ |
| |
|
RespuestaThemeninformationenDieses Thema ha 2 subscriber: |