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. » | | - Página 2 - |
|  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 ▲ |
| |  |
| | | | | - Página 1 - |
|  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 ▲ |
| |
| | | | - Página 2 - |
| |  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 ▲ |
| |
| |  Jörg Sellmeyer | ¡Hola Matthias, danke dass du dich como así reinhängst. Leider es así siempre todavía no brauchbar: 1. drängelt se el Treeview siempre otra vez en el Vordergrund, auch si Tab 2 oder 3 eigentlich aktiv son. El son tan beide leer y debería eben kein Treeview Mostrar. 2. es sí el Resize después de el WaitInput una Totschläger, el en el Grunde el todo Subclassgeschichte ad absurdum führt. Dem podría uno todavía engegenwirken, indem el Proc sólo aufgerufen se, si la Größe el Ventana se tatsächlich verändert ha. Dafür müssten entonces Breite y Höhe en Extravariablen überwacht voluntad, qué auch otra vez el Grundgedanken des Subclassings zuwiderläuft. Hinzu kommt sí todavía, dass auch TabChanged no correcto funktioniert. Das reagiert auch sólo muy erratisch y en el Prograqmm überwache Yo el sí por OldTab% y AktiveTab%. Lo scheint, como si Profano con el Handling el commctrl.Elemente algo überfordert es. Im Moment scheint lo me, como si el así una Sackgasse es. Tal vez kann Roland sí algo dazu sagen. |
| | | | |
| |  Matthias Arlt | Das war me todavía nada aufgefallen, daß se el TreeView en todos Tabs drängelt. Und sí, el Ganze es no sin "Verrenkungen". An se wäre el SubClassing vollkommen überflüssig, porque el Rebar-Control todos Noticias, auch el el Child-Controls, ans Parent weiterreicht. Nur kommen el hay en unserem Fall no a... |
| | | WinXP SP2, Win7 - XProfan 10/11/FreeProfan32 - Xpia | 19.06.2020 ▲ |
| |
| |  Jörg Sellmeyer | Exactamente. Wenn el Notify-Messages ordentlich durchgereicht würden, wäre el una Klacks, würd Yo veces sagen. So es Murx 
Und es eigentlich una muy schönes Element, qué vielseitig einzusetzen wäre. |
| | | Windows XP SP2 XProfan X4... und hier mal was ganz anderes als Profan ...  | 19.06.2020 ▲ |
| |
| |  Matthias Arlt | Wobei uno tal vez auch el Erwartung algo einschränken muß, je después de el, cómo el Definition en MSDN versteht: A Rebar control acts as a container for child windows. It can contain one or more bands, and each band can have any combination of a gripper bar, a bitmap, a texto label, and one child window. An application assigns a child window—typically another control— to a rebar control band.
El Rede es sólo de je una Control, no de uno Kaskade mehrerer multifunktionaler Elemente con un undefinierten Bundle de Noticias. |
| | | WinXP SP2, Win7 - XProfan 10/11/FreeProfan32 - Xpia | 19.06.2020 ▲ |
| |
| |  Jörg Sellmeyer | Sí aber musas sí sólo veces ausreizen, qué así hacer kann, bevor uno lo entonces evtl doch ad acta legen muss. |
| | | | |
| |  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 ▲ |
| |
| |  Jörg Sellmeyer | Wow - großartig. So en etwa Tuve lo me eigentlich vorgestellt pero no pensamiento, dass lo entonces doch así "simpel" klappt. Ganz großen Dank. |
| | | | |
| |  Jörg Sellmeyer | %notifycode funktioniert ahora. Se puede also con Profanmitteln el Subclassproc steuern.
Aunque lässt se
no por
sustituir. Also scheint como todavía qué no a stimmen. |
| | | Windows XP SP2 XProfan X4... und hier mal was ganz anderes als Profan ...  | 21.06.2020 ▲ |
| |
| |  Matthias Arlt | ...%notifycode funktioniert ahora. Se puede also con Profanmitteln...
Sí, había Yo auch festgestellt. Ob el aber siempre así es ? So largo lo como todavía Ungereimtheiten son, mach Yo el innerhalb vom SubClassing más bien en el otro Weise. Zudem schadet no, si uno weiß, a welcher Punto en wParam/lParam qué es. Se puede gezielter en así manches reagieren.
¬ifywnd probablemente sólo entonces sicher gefüllt, si auch el zugehörige Ereignis, also %wmnotify, sicher ausgewertet se. En TCN_SELCHANGE es el bspw. el Fall, en diversen otro Notifications pero no. |
| | | WinXP SP2, Win7 - XProfan 10/11/FreeProfan32 - Xpia | 21.06.2020 ▲ |
| |
|
RespuestaThemeninformationenDieses Thema ha 2 subscriber: |