| |
|
|
Uwe ''Pascal'' Niemeier | Hi Roland!
have straight fixes, that itself SubClassProc not OwnerDraw-Menüs utilize can, because selbige by TrackPopupMenu -API called go must and SubClassProc thereby not clutching (only WaitInput or the Profan-Internen TrackMenu )
suggestion: One SubClassMode or Ähnliches, with the The Proc permanent called becomes, even if the Prog not explizit on something wait (means analog to method with ProcAddr ). Möglicherweise not integrally unproblematisch with the application, but: No Risk, No Fun would be for Sonderfälle anyway useful.
SeeYou Pascal |
|
|
| |
|
|
|
Andreas Miethe
| Uwe Pascal Niemeier
Hi Roland! have straight fixes, that itself SubClassProc not OwnerDraw-Menüs utilize can, because selbige by TrackPopupMenu -API called go must and SubClassProc thereby not clutching (only WaitInput or the Profan-Internen TrackMenu ) suggestion: One SubClassMode or Ähnliches, with the The Proc permanent called becomes, even if the Prog not explizit on something wait (means analog to method with ProcAddr ). Möglicherweise not integrally unproblematisch with the application, but: No Risk, No Fun would be for Sonderfälle anyway useful. SeeYou Pascal
Why must The because by TrackPopupMenu called go ? the kapier I somehow not. I suppose, You refer you here on Trackmenüs ? or too Fenstermenüs ? |
|
|
| Gruss Andreas ________ ________ ________ ________ _ Profan 3.3 - XProfanX2 Win 95,98,ME,2000,XP,Vista - Win 7 32 / 64 Bit ASUS X93S - Intel Core I7-NVIDIA GForce 540M 8GB Arbeitsspeicher Homepage : [...] | 02/14/09 ▲ |
|
|
|
|
Uwe ''Pascal'' Niemeier | Hi Andreas!
Why must The because by TrackPopupMenu called go ? I suppose, You refer you here on Trackmenüs ?
Yepp! and the must Yes by API laid out go, circa tappt im dunkeln To manipulating (OwnerDraw settle), because the profane CreateMenu no lever zurückgibt. inverse relating itself Profans TrackMenu only on Menüs, The even by Profan created get. or Gibts for already ne Systemvariable?
it be because...(be I even first on it come ) If one no TrackMenü anlegt and nevertheless attempts, one aufzurufen, appear instead the latest Pop-Menu the Fensters, on the one Yes by &hMenu drankommt.
foreseen of it can it indeed Cases give, in them one SubClassing generally benefit wants, during the program straight with something engage is (even if the Timing there Perhaps something hairy go could)
SeeYou Pascal |
|
|
| |
|
|
|
Andreas Miethe
| Uwe Pascal Niemeier
Hi Andreas!
Yepp! and the must Yes by API laid out go, circa tappt im dunkeln To manipulating (OwnerDraw settle), because the profane CreateMenu no lever zurückgibt. inverse relating itself Profans TrackMenu only on Menüs, The even by Profan created get. or Gibts for already ne Systemvariable?
the example shows, that it too differently goes. is on The speedy zusammenkopiert, means not yet integrally reif. CompileMarkSeparationHeader-Dateien
$H windows.ph
$H messages.ph
Declare Ende&
Declare Rect1#,hIcon1&,lpmis#,Size#
Dim Rect1#,16
Dim lpmis#,24
Dim Size#,8
Declare MyItem#[3]reicht für 4 Einträge
Struct Item = Eintrag&,Icon&
Dim MyItem#[],Item
Var Text$ = Info
Var Text2$ = Beenden
MyItem#[0].Eintrag& = Addr(Text$)
MyItem#[1].Eintrag& = Addr(Text2$)
MyItem#[0].Icon& = ~LoadIcon(%hInstance,A)
MyItem#[1].Icon& = ~LoadIcon(%hInstance,Eimer)
Proc Menue
CreateMenu
AppendMenu 101, Info
~ModifyMenu(&hMenu,101,~MF_BYCOMMAND | ~MF_OWNERDRAW,101,MyItem#[0])
AppendMenu 103, Beenden
~ModifyMenu(&hMenu,103,~MF_BYCOMMAND | ~MF_OWNERDRAW,103,MyItem#[1])
Return @TrackMenu()
EndProc
Windowstyle 26 + 512
WindowTitle Test
Window 0,0-640,480
SubClass %HWnd, 1
Whilenot Ende&
Waitinput
If %MousePressed = 2Rechter Mausbutton gedrückt
Menue()
If (%MenuItem = 101)
@Messagebox(Programmiert in XProfan 11,Hinweis,64)
ElseIf (%MenuItem = 103)
Ende&=1
EndIf
Endif
Endwhile
Dispose Rect1#,lpmis#,Size#
End
SubClassProc
If SubClassMessage(%hWnd,~WM_MEASUREITEM)
lpmis# = &slParam
~GetTextExtentPoint32(%hdc,Long(Long(&slParam,20),0),Len(String$(Long(Long(&slParam,20),0),0)),Size#)
Long lpmis#,12 = Long(Size#,0)
Set(WinProc, 0)
ElseIf SubClassMessage(%hWnd,~WM_DRAWITEM)
IF Long(&slParam,16) & 1wenn selektiert
~SetTextColor(Long(&slParam,24),$FFFFFF)
~SetBkColor(Long(&slParam,24),$8000)
Else
~SetTextColor(Long(&slParam,24),0)
~SetBkColor(Long(&slParam,24),$FCFDC8)
EndIf
Rechteck für die Ausgabe ermitteln
Long Rect1#,0 = Long(&slParam,28)X
Long Rect1#,4 = Long(&slParam,32)Y
Long Rect1#,8 = Long(&slParam,36)Breite
Long Rect1#,12 =Long(&slParam,40)Höhe
Ausgabe
~ExtTextOut(Long(&slParam,24),Long(&slParam,28)+20,Long(&slParam,32),~ETO_OPAQUE,Rect1#,Long(Long(&slParam,44),0),Len(String$(Long(Long(&slParam,44),0),0)) ,0)
~DrawIconEx(Long(&slParam,24),0,Long(&slParam,32),Long(Long(&slParam,44),4),13,13,0,0,~DI_NORMAL)
Set(WinProc, 0)
EndIf
ENDPROC
|
|
|
| Gruss Andreas ________ ________ ________ ________ _ Profan 3.3 - XProfanX2 Win 95,98,ME,2000,XP,Vista - Win 7 32 / 64 Bit ASUS X93S - Intel Core I7-NVIDIA GForce 540M 8GB Arbeitsspeicher Homepage : [...] | 02/14/09 ▲ |
|
|
|
|
| the functions super by me! |
|
|
| |
|
|
|
| |
|
| |
|
|
|
Uwe ''Pascal'' Niemeier | *sichvordenkopfschlag*
I say Yes: I and the System-Variables... (somehow think I always, The Biester wären konstant )
nevertheless let I my suggestion time so stand
@ Andreas: Leite your code still at times HoHo moreover!
SeeYou Pascal |
|
|
| |
|
|
|
RGH | Hi, between CreateMenu and TrackMenu() has &Menu the lever the PopUp-Menüs!
Greeting Roland |
|
|
| Intel Duo E8400 3,0 GHz / 4 GB RAM / 1000 GB HDD - ATI Radeon HD 4770 512 MB - Windows 7 Home Premium 32Bit - XProfan X4 | 02/14/09 ▲ |
|
|
|