Forum | | | | - page 1 - |
|  Jörg Sellmeyer | Wahrscheinlich überseh je grad irgendwas total Banales mais je bekomm es pas hin, qui Hauteur cet Rebar-Controls trop changement. qui Breite passt sich oui wunderbar automatisch à, mais cela Dingen reagiert pas du tout sur SetWindowPos.
'$I Rebar.inc
'{ Rebar.inc:
$H Windows.ph
$H Messages.ph
$H commctrl.ph
Proc InitCommControls
Déclarer cmctrl#
Faible cmctrl#,16
Claire cmctrl#
Long cmctrl#,0=8' hiermit wird cela Rebar-Contrôle aktiviert
Long cmctrl#,4=$FFFF'---Alles initialisieren
Externe("comctl32.dll","InitCommonControlsEx",cmctrl#)
Dispose cmctrl#
ENDPROC
struct RebarInfo=Size&,Mask&,Style&,clrFore&,clrBack&,lpText&,cch&,iImage&,hwndChild&,\
cxMinChild&,cyMinChild&,cx&,hbmBack&,wID&,cyChild&,cyMaxChild&,cyIntegral&,\
cxIdeal&,lParam&,cxHeader&
Déclarer RebarInfo#
Faible RebarInfo#,RebarInfo
SubProc Créer.Rebar
Paramètres hParent&,Text$,x%,y%,b%,h%,Orientation&
Cas Orientation& = 1:Orientation& = $80'vertikales Rebar
With RebarInfo#
.Size& = SizeOf(RebarInfo#)
.Mask& = ~RBBIM_STYLE
EndWith
Retour Contrôle(~REBARCLASSNAME,Text$,$50000804 | Orientation& | ~RBS_DBLCLKTOGGLE | ~RBS_AUTOSIZE,x%,y%,b%,h%,hParent&,0,$60300)
ENDPROC
Créer("Container","Rebar")
SubProc Rebar.Ajouter
Paramètres RB&,hwndChild&,cxMinChild&,cyMinChild&,cx&
Claire RebarInfo#
With RebarInfo#
.Size& = SizeOf(RebarInfo#)
.Mask& = ~RBBIM_STYLE | ~RBBIM_CHILD | ~RBBIM_CHILDSIZE | ~RBBIM_SIZE
.cxMinChild& = cxMinChild&
.cyMinChild& = cyMinChild&
.cx& = cx&' Voreinstellung pour Breite,bzw. Hauteur. Je pour Orientation&
.hwndChild& = hwndChild&
Si SendMessage(RB&,~RB_GETBANDCOUNT,0,0) = 0
.Style&=~RBBS_NOGRIPPER | ~RBBS_CHILDEDGE
SendMessage(RB&,~RB_INSERTBANDA,0,RebarInfo#)
D'autre
.Style&=~RBBS_GRIPPERALWAYS | ~RBBS_CHILDEDGE
SendMessage(RB&,~RB_INSERTBANDA,-1,RebarInfo#)
'-1 = à dernier Stelle anhängen
EndIf
EndWith
ENDPROC
'Rebar.inc Ende
'}
RBBIM_SIZE
SubClassProc
Si SubClassMessage(%hWnd, ~wm_sizing)
Resize
Set("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
Déclarer hList&, hTV&,hEdit&
Fenêtre 800,600
Var Rebar& = Créer("Rebar",%hwnd,»,0,0,Width(%hwnd),Height(%hwnd),0)' si ici comme letztes 1 angegeben wird, ist cela RebarControl vertikal
hList& = Créer("Listbox",%hwnd,0,0,0,0,0)
hEdit& = Créer("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
Tandis que 1
WaitInput
Si %Key = 4
Resize
SetWindowPos Rebar& = 0,0 - (Width(%hwnd)),(Height(%hwnd)-2)
EndIf
Wend
SubClass %HWnd, 0
SubClass Rebar&,0
|
| | | | |
|  | « cette Beitrag wurde comme Solution gekennzeichnet. » | |  Matthias Arlt |   je hab mir fois le Mühe gemacht et den Source quelque chose umgebaut et bereinigt. Pour cette était je gestern ensuite doch trop fatigué. eh bien klappt cela aussi avec TabControl et TreeView. Sogar sans FastMode. maintenant venons aussi qui Benachrichtigungen vom Rebar par.
'Rebar direct sur HWND
$H Windows.ph
$H Messages.ph
$H commctrl.ph
declare rect#
dim rect#,16
proc InitCommCtrl
declare icc#
dim icc#,16
long icc#,0=8
long icc#,4=$FFFF
external("comctl32.dll","InitCommonControlsEx",icc#)
dispose icc#
endproc
InitCommCtrl
proc RebarBandInfo
parameters Rebar&,msg&,num&,mask&,style&,child&
declare 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#)
dispose Rebar#
endproc
'{ SubClassProc:
SubClassProc
Si SubClassMessage(%hWnd, 78)
Si Long(&slparam,0) = Rebar&
Si (Long(&slparam,8) = -839) or (Long(&slparam,8) = -836)'RBN_CHILDSIZE ou bien RBN_ENDDRAG
Resize
Set("WinProc", 1)
EndIf
ElseIf Long(&slparam,0) = hTab&
Si Long(&slparam,8) = -551'TCN_SELCHANGE
Resize
Set("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#
cas GetActiveTab(hTab&)=0 : sendmessage(Rebar&,~RB_GETRECT,0,rect#)
SetWindowPos TV& = Long(rect#,0),25 - (Long(rect#,8) - 12),(Long(rect#,12) - 29);1
ENDPROC
declare Rebar&,hList&,hEdit&,TV&,TVR1&,hDlg&,hTab&
Déclarer ActiveTab%,OldTab%
cls
'{ Rebarelemente:
hDlg& = Contrôle("Dialogue",»,$54000000,2,25,180,0,%hwnd,0,%HINSTANCE)
hEdit&=create("MultiEdit",%hwnd,»,0,0,0,0)
'}
'{ Rebar:
ReBar&=Contrôle("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& = Créer("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& = Long(rect#,0),Long(rect#,4),Long(rect#,8),Long(rect#,12);1
SetWindowPos hTab& = 0,0 - Width(hDlg&),Height(hDlg&);1
'{ Treeview:
TV& = Créer("TreeView",hTab&,0,2,25,(Width(hTab&) - 6),(Height(hTab&) - 29))
WhileLoop 3
TVR1& = TreeView("InsertItem",TV&,0,0,"Root " + Str$(&Boucle))
TreeView("SetChildren", TV&,TVR1&, 1)
WhileLoop 5
TreeView("InsertItem",TV&,TVR1&,0,"Eintrag " +Str$(&Boucle))
Wend
TreeView("Expand", TV&, TVR1&, 3)
Wend
'}
'Hauptsachleife:
'set("FASTMODE",1)
SubClass %HWnd, 1
Resize
tandis que 1
waitinput
cas %clé = 4 : Resize
Wend
et qui Hauptschleife ist sur einmal gaaanz schlank... |
| | | WinXP SP2, Win7 - XProfan 10/11/FreeProfan32 - Xpia | 20.06.2020 ▲ |
| |  |
| |  Matthias Arlt | cela allez avec RB_SETBANDINFO. qui gleiche REBARBANDINFO-Struktur senden, separat pour chaque ruban et chez .cyMinChild&=height(hwnd&) pour qui Hauteur et .cx&=width(hwndChild&) pour qui Breite einsetzen. Jeweils pour dem 'SetWindowPos Rebar&...' cela SubClassing ist pour ggf. entbehrlich. |
| | | WinXP SP2, Win7 - XProfan 10/11/FreeProfan32 - Xpia | 16.06.2020 ▲ |
| |
| |  Jörg Sellmeyer | merci, quelque chose comme hab je befürchtet. cet Strukturgeschiebe veux iwie nie so richtig dans meinen tête rein. cela Subclassing hab je la fois ausgeschaltet et es venons réellement quand même Ergebnisse. Allerdings pas, comment gewünscht. qui liste sur qui linken page ändert ses Taille, si vous sich aussi pas à qui Taille des Rebars anpassen veux  cela Multiedit reagiert malheureusement gar pas sur den Aufruf de Rebar("Resize",...) Peut-être cet Rebar oui aussi gar njicht wirklich gedacht pour cette Einsatz. Pour allem, quoi je so gelesen habe, wird es plutôt comme Toolbar eingesetzt, et pas tellement, um cela la fenêtre trop strukturieren.
'$I Rebar.inc
'{ Rebar.inc:
$H Windows.ph
$H Messages.ph
$H commctrl.ph
Proc InitCommControls
Déclarer cmctrl#
Faible cmctrl#,16
Claire cmctrl#
Long cmctrl#,0=8' hiermit wird cela Rebar-Contrôle aktiviert
Long cmctrl#,4=$FFFF'---Alles initialisieren
Externe("comctl32.dll","InitCommonControlsEx",cmctrl#)
Dispose cmctrl#
ENDPROC
struct RebarInfo=Size&,Mask&,Style&,clrFore&,clrBack&,lpText&,cch&,iImage&,hwndChild&,\
cxMinChild&,cyMinChild&,cx&,hbmBack&,wID&,cyChild&,cyMaxChild&,cyIntegral&,\
cxIdeal&,lParam&,cxHeader&
Déclarer RebarInfo#
Faible RebarInfo#,RebarInfo
SubProc Créer.Rebar
Paramètres hParent&,Text$,x%,y%,b%,h%,Orientation&
Cas Orientation& = 1:Orientation& = $80'vertikales Rebar
With RebarInfo#
.Size& = SizeOf(RebarInfo#)
.Mask& = ~RBBIM_STYLE
EndWith
Retour Contrôle(~REBARCLASSNAME,Text$,$50000804 | Orientation& | ~RBS_DBLCLKTOGGLE | ~RBS_AUTOSIZE | ~RBBS_CHILDEDGE,x%,y%,b%,h%,hParent&,0,$60300)
ENDPROC
Créer("Container","Rebar")
SubProc Rebar.Resize
Paramètres RB&,hwndChild&,cyMinChild&,cx&
Claire 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.Ajouter
Paramètres RB&,hwndChild&,cxMinChild&,cyMinChild&,cx&
Claire RebarInfo#
With RebarInfo#
.Size& = SizeOf(RebarInfo#)
.Mask& = ~RBBIM_STYLE | ~RBBIM_CHILD | ~RBBIM_CHILDSIZE | ~RBBIM_SIZE
.cxMinChild& = cxMinChild&
.cyMinChild& = cyMinChild&
.cx& = cx&' Voreinstellung pour Breite,bzw. Hauteur. Je pour Orientation&
.hwndChild& = hwndChild&
Si SendMessage(RB&,~RB_GETBANDCOUNT,0,0) = 0
.Style&=~RBBS_NOGRIPPER | ~RBBS_CHILDEDGE
SendMessage(RB&,~RB_INSERTBANDA,0,RebarInfo#)
D'autre
.Style&=~RBBS_GRIPPERALWAYS | ~RBBS_CHILDEDGE
SendMessage(RB&,~RB_INSERTBANDA,-1,RebarInfo#)
'-1 = à dernier Stelle anhängen
EndIf
EndWith
ENDPROC
'Rebar.inc Ende
'}
SubClassProc
Si SubClassMessage(%hWnd, ~wm_sizing)
Resize
Set("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
Déclarer hList&, hTV&,hEdit&
Fenêtre 800,600
Var Rebar& = Créer("Rebar",%hwnd,»,0,0,Width(%hwnd),Height(%hwnd),0)' si ici comme letztes 1 angegeben wird, ist cela RebarControl vertikal
hList& = Créer("Listbox",%hwnd,0,0,0,0,0)
hEdit& = Créer("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
Tandis que 1
WaitInput
Si %Key = 4
Resize
SetWindowPos Rebar& = 0,0 - (Width(%hwnd)),(Height(%hwnd))
EndIf
Wend
SubClass %HWnd, 0
SubClass Rebar&,0
|
| | | | |
| |  Matthias Arlt | So sollte es aller. là FreeProfan Deinen Code pas mochte, hab je cela la fois umgeschrieben. So ist es aussi kompakter.
proc InitCommCtrl
declare icc#
dim icc#,16
long icc#,0=8
long icc#,4=$FFFF
external("comctl32.dll","InitCommonControlsEx",icc#)
dispose icc#
endproc
InitCommCtrl
proc RebarBandInfo
parameters Rebar&,msg&,num&,mask&,style&,child&
declare 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#)
dispose Rebar#
endproc
declare Rebar&,hList&,hEdit&
cls
hList&=create("Listbox",%hwnd,»,0,0,100,0)
hEdit&=create("MultiEdit",%hwnd,»,0,0,0,0)
ReBar&=Contrôle("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&)
tandis 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 | et quoi cela "Strukturgeschiebe" angeht...so grave ist cela gar pas. qui komplette Struktur ist arrêt qui je pour Contrôle toujours juste aufgebaute Block à Informationen, qui cela Contrôle pour Erscheinungsbild et Funktion braucht. qui Infos stehen aussi i.d.R. toujours à gleicher Stelle im Block. je dois alors je Aufruf toujours seulement qui se mettre im Block écrivons, qui sich geändert avons ou bien pour mich de intérêt sommes. Um chez unserem Beispiel trop rester:
je devrait pour qui Größenänderung eigentlich seulement qui se mettre pour height() et width() avec qui Message RB_SETBANDINFO senden, car qui übrigen im Block enthaltenen Infos avons sich oui pas geändert. cela Contrôle hat vous oui bereits. Es schadet mais aussi pas, si je mask, style, child usw. erneut aussi avec sende. je spare mir dans diesem le cas une zweite Proc et peux pour Erzeugung (RB_INSERTBAND) et Resizing (RB_SETBANDINFO) un et qui selbe verwenden. |
| | | WinXP SP2, Win7 - XProfan 10/11/FreeProfan32 - Xpia | 16.06.2020 ▲ |
| |
| |  Jörg Sellmeyer | merci! Hat mich maintenant quelque chose Grübelarbeit gekostet, weil je deinen Code erstmal wieder traduire et comprendre musste, là du z. B. Messagenummern, anstelle qui commctrl-Bezeichner prends. et je voulais oui savons, wohin dans mon Code qui faute ist. Letztlich était es ensuite seulement qui fehlende Indexnummer, qui meinen Code ausgebremst hat. qui J'avais oublié anzupassen. sendmessage(Rebar&,msg&,num&,Rebar#) |
| | | | |
| |  Jörg Sellmeyer | comment bekomme je car maintenant avec, si mittels des Rebar-Anfassers qui Controls modifié volonté? je hab un Tabcontrol sur einem ruban et là wiederum plusieurs Controls sur elle. quelle Message muss je surveiller, à Größenänderung ensuite aussi anzuwenden. cela Tabcontrol passt sich oui automatisch à mais qui daraufliegenden Controls naturellement pas. |
| | | Windows XP SP2 XProfan X4... und hier mal was ganz anderes als Profan ...  | 17.06.2020 ▲ |
| |
| |  Matthias Arlt | qui einfachste Possibilité wäre, pour dem 'waitinput' qui Msg RB_GETRECT trop senden:
dim rect#,16 sendmessage(Rebar&,1033,BandNum&,rect#)
qui aktuellen Koordinaten des interessierenden Bands stehen ensuite dans rect# zur weiteren Verwendung. |
| | | WinXP SP2, Win7 - XProfan 10/11/FreeProfan32 - Xpia | 17.06.2020 ▲ |
| |
| |  Jörg Sellmeyer | cela WaitInput wird seulement pas durchbrochen, si on cela ruban "zieht". cela est, cela ruban + Child volonté korrekt angepasst, au cours de cela daraufliegende Trieview sich pas ändert. seulement pour einem Klick ou bien Tastendruck wird cela angepasst. |
| | | | |
| |  Matthias Arlt | ensuite wirst Du à cette Stelle doch sur Subclassing zurückgreifen doit:
|
| | | WinXP SP2, Win7 - XProfan 10/11/FreeProfan32 - Xpia | 17.06.2020 ▲ |
| |
| |  Jörg Sellmeyer | je bekomme es pas hin. Profan empfängt de dem Rebar aucun Messages, scheint es mir.
je hab la fois deux Codevarianten erstellt. Einmal hab je cela Rebar-Contrôle direct aufs Hauptfenster gepappt, là blockiert cela Programme, si je qui Sous-classe-Routine einbaue. Zweitens liegt cela Rebar-Contrôle sur einem Dialog-Static. là fonctionne cela Programme zwar plus mais es volonté aucun Messages ausgelöst, qui cela Subclassing aktivieren. Hilfreich wäre es wahrscheinlich, si Profan là qui Notify-Messages empfangen serait mais cela Rebar leitet rien en à Profan plus, bzw Profan empfängt qui pas 
il y a une Reihe de Notify-Messages, qui oui c'est ca convenable pour wären. ZB:
RBN_CHILDSIZE Sent by a rebar control when a band's child window is resized. This notification code is sent dans le forme of a WM_NOTIFY message. [...] 
'Rebar direct sur HWND
$H Windows.ph
$H Messages.ph
$H commctrl.ph
declare rect#
dim rect#,16
proc InitCommCtrl
declare icc#
dim icc#,16
long icc#,0=8
long icc#,4=$FFFF
external("comctl32.dll","InitCommonControlsEx",icc#)
dispose icc#
endproc
InitCommCtrl
proc RebarBandInfo
parameters Rebar&,msg&,num&,mask&,style&,child&
declare 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#)
dispose Rebar#
endproc
'{ SubClassProc:
SubClassProc
Si SubClassMessage(%hWnd, 78)
Si Long(&slparam,0) = Rebar&
'ici RB_GETRECT senden
'sendmessage(Rebar&,1033,0,rect#)
Resize
EndIf
Set("WinProc", 0)
EndIf
ENDPROC
Proc Resize
Claire 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& = Long(rect#,0),25 - (Long(rect#,8) - 12),(Long(rect#,12) - 29)';1
ENDPROC
declare Rebar&,hList&,hEdit&,TV&,TVR1&,hDlg&,hTab&
Déclarer ActiveTab%,OldTab%
cls
'{ Rebarelemente:
hDlg& = Contrôle("Dialogue",»,$54000000,2,25,180,0,%hwnd,0,%HINSTANCE)
hEdit&=create("MultiEdit",%hwnd,»,0,0,0,0)
'}
'{ Rebar:
ReBar&=Contrôle("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& = Créer("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& = Long(rect#,0),Long(rect#,4),Long(rect#,8),Long(rect#,12);1
SetWindowPos hTab& = 0,0 - Width(hDlg&),Height(hDlg&);1
'{ Treeview:
TV& = Créer("TreeView",hTab&,0,2,25,(Width(hTab&) - 6),(Height(hTab&) - 29))
WhileLoop 3
TVR1& = TreeView("InsertItem",TV&,0,0,"Root " + Str$(&Boucle))
TreeView("SetChildren", TV&,TVR1&, 1)
WhileLoop 5
TreeView("InsertItem",TV&,TVR1&,0,"Eintrag " +Str$(&Boucle))
Wend
TreeView("Expand", TV&, TVR1&, 3)
Wend
'}
SubClass %HWnd, 1
'Hauptsachleife:
tandis que 1
waitinput
Titre de la fenêtre Str$(&NotifyWnd) + " " + Str$(Rebar&) + " " + Str$(%notifycode)
ActiveTab% = GetActiveTab(hTab&)
Si OldTab% <> ActiveTab%
ShowWindow(Tv&,ActiveTab% = 0)
ActiveTab% = GetActiveTab(hTab&)
Si (ActiveTab% = 0)' and GetFocus(Rebar&)
Resize
' SendMessage(hTab&,~TCM_SETCURSEL,0,0)
EndIf
EndIf
Si %clé = 4
Resize
EndIf
OldTab% = GetActiveTab(hTab&)
Wend
SubClass %HWnd, 0
'Rebar sur le dialogue-Static
$H Windows.ph
$H Messages.ph
$H commctrl.ph
declare rect#
dim rect#,16
proc InitCommCtrl
declare icc#
dim icc#,16
long icc#,0=8
long icc#,4=$FFFF
external("comctl32.dll","InitCommonControlsEx",icc#)
dispose icc#
endproc
InitCommCtrl
proc RebarBandInfo
parameters Rebar&,msg&,num&,mask&,style&,child&
declare 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#)
dispose Rebar#
endproc
'{ SubClassProc:
SubClassProc
Si SubClassMessage(%hWnd, 78)
Si Long(&slparam,0) = Rebar&
'ici RB_GETRECT senden
'sendmessage(Rebar&,1033,0,rect#)
Resize
EndIf
Set("WinProc", 0)
EndIf
ENDPROC
Proc Resize
setwindowpos hRBDlg& = 0,0-width(%hwnd),height(%hwnd)
Claire 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& = Long(rect#,0),25 - (Long(rect#,8) - 12),(Long(rect#,12) - 29)';1
ENDPROC
declare Rebar&,hList&,hEdit&,TV&,TVR1&,hDlg&,hTab&
Déclarer ActiveTab%,OldTab%
cls
'{ Rebarelemente:
hDlg& = Contrôle("Dialogue",»,$54000000,2,25,180,0,%hwnd,0,%HINSTANCE)
hEdit&=create("MultiEdit",%hwnd,»,0,0,0,0)
'}
'{ Rebar:
Var hRBDlg& = Contrôle("Dialogue",»,$54000000,0,0,Width(%hwnd),Height(%hwnd),%hwnd,0,%HINSTANCE)
ReBar&=Contrôle("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& = Créer("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& = Long(rect#,0),Long(rect#,4),Long(rect#,8),Long(rect#,12);1
SetWindowPos hTab& = 0,0 - Width(hDlg&),Height(hDlg&);1
'{ Treeview:
TV& = Créer("TreeView",hTab&,0,2,25,(Width(hTab&) - 6),(Height(hTab&) - 29))
WhileLoop 3
TVR1& = TreeView("InsertItem",TV&,0,0,"Root " + Str$(&Boucle))
TreeView("SetChildren", TV&,TVR1&, 1)
WhileLoop 5
TreeView("InsertItem",TV&,TVR1&,0,"Eintrag " +Str$(&Boucle))
Wend
TreeView("Expand", TV&, TVR1&, 3)
Wend
'}
SubClass %HWnd, 1
'Hauptsachleife:
tandis que 1
waitinput
Titre de la fenêtre Str$(&NotifyWnd) + " " + Str$(Rebar&) + " " + Str$(%notifycode)
ActiveTab% = GetActiveTab(hTab&)
Si OldTab% <> ActiveTab%
ShowWindow(Tv&,ActiveTab% = 0)
ActiveTab% = GetActiveTab(hTab&)
Si (ActiveTab% = 0)
Resize
EndIf
EndIf
Si %clé = 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 | Pour un paire kleinen Changements fonctionne es chez mir (sous 11.2 et FreeProfan32):
'Rebar direct sur HWND
$H Windows.ph
$H Messages.ph
$H commctrl.ph
declare rect#
dim rect#,16
proc InitCommCtrl
declare icc#
dim icc#,16
long icc#,0=8
long icc#,4=$FFFF
external("comctl32.dll","InitCommonControlsEx",icc#)
dispose icc#
endproc
InitCommCtrl
proc RebarBandInfo
parameters Rebar&,msg&,num&,mask&,style&,child&
declare 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#)
dispose Rebar#
endproc
'{ SubClassProc:
SubClassProc
Si SubClassMessage(%hWnd, 78)
Si Long(&slparam,0) = Rebar&
Si Long(&slparam,8) = -14'NM_NCHITTEST
Resize
Set("WinProc", 1)
EndIf
EndIf
EndIf
ENDPROC
Proc Resize
Claire 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& = Long(rect#,0),25 - (Long(rect#,8) - 12),(Long(rect#,12) - 29);1
ENDPROC
declare Rebar&,hList&,hEdit&,TV&,TVR1&,hDlg&,hTab&
Déclarer ActiveTab%,OldTab%
cls
'{ Rebarelemente:
hDlg& = Contrôle("Dialogue",»,$54000000,2,25,180,0,%hwnd,0,%HINSTANCE)
hEdit&=create("MultiEdit",%hwnd,»,0,0,0,0)
'}
'{ Rebar:
ReBar&=Contrôle("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& = Créer("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& = Long(rect#,0),Long(rect#,4),Long(rect#,8),Long(rect#,12);1
SetWindowPos hTab& = 0,0 - Width(hDlg&),Height(hDlg&);1
'{ Treeview:
TV& = Créer("TreeView",hTab&,0,2,25,(Width(hTab&) - 6),(Height(hTab&) - 29))
WhileLoop 3
TVR1& = TreeView("InsertItem",TV&,0,0,"Root " + Str$(&Boucle))
TreeView("SetChildren", TV&,TVR1&, 1)
WhileLoop 5
TreeView("InsertItem",TV&,TVR1&,0,"Eintrag " +Str$(&Boucle))
Wend
TreeView("Expand", TV&, TVR1&, 3)
Wend
'}
'Hauptsachleife:
SubClass %HWnd, 1
tandis que 1
waitinput
Resize
Titre de la fenêtre Str$(&NotifyWnd) + " " + Str$(Rebar&) + " " + Str$(%notifycode)
ActiveTab% = GetActiveTab(hTab&)
Si OldTab% <> ActiveTab%
ShowWindow(Tv&,ActiveTab% = 0)
ActiveTab% = GetActiveTab(hTab&)
Si (ActiveTab% = 0)' and GetFocus(Rebar&)
Resize
'SendMessage(hTab&,~TCM_SETCURSEL,0,0)
EndIf
EndIf
Si %clé = 4
Resize
EndIf
OldTab% = GetActiveTab(hTab&)
Wend
SubClass %HWnd, 0
un weiteres Resize pour dem WaitInput était notwendig et qui Auswertung de NM_NCHITTEST im SubClassing. Eleganter wäre RBN_ENDDRAG gewesen, dringt mais là pas par. je denke, so allez cela sûrement aussi...
Nachtrag: avec den gleichen Changements fonctionne es aussi avec dem Dialog comme Parent. cela SubClassing doit ensuite naturellement pour den Dialog avoir lieu, statt pour %HWND. |
| | | WinXP SP2, Win7 - XProfan 10/11/FreeProfan32 - Xpia | 19.06.2020 ▲ |
| |
|
répondreOptions du sujet | 9.224 Views |
Themeninformationencet Thema hat 2 participant: |