I have a question about TPopoupMenu and OwnDDraw. I'm trying to do some custom drawings and I'm setting ownership to the right and fixed event handler onDrawItem. I call on my portfolio to call. Ondrights with popups (X, Y) are never called. What am I doing wrong here? Edit:
Edit:
My further discoveries have shown that there is a problem while using VCL styles, I have an OnDrawItem and OnMeasureItem Assigned Now those handlers are called. The usual way to implement OnDrawItem is not working so I tried to use VCL styles but my popup menu does not show any text.
My Event Handler Code (Ondrite):
Process TMyDisplay.EngineMenuDraw (Sender: TubEygect; AceNova: Tiknavas; Act: TRect; selected: Boolean); Var LStyles: TCustomStyleServices; text string; Const Color Stats: Array [Boolean] TSTleclosure = (scComboBoxDisabled, scComboBox); FontColorStates: array [boolean] TStyleFont = (sfPopupMenuItemTextDisabled, sfPopupMenuItemTextNormal); Launch LStyles: = Style Services; Text: = (Sender as TMANUIT). Caption; Aisenvas Brush. Color: = LSEL. Gate Styler (ColorStates [(TMANUITM as sender)) enabled); Asynavous font Color: = LSEEl Gate style font collar (fontcolorrestates [(TMANUITM as sender) was enabled)); If chosen, ACNews begins. Brush. Color: = LStyles.GetSystemColor (clHighlight); Ainvas.Font Color: = LSEEgateSystemroll (Cloughtit Text); End; ACanvas.FillRect (ARect); ACanvas.TextOut (ARect.Left + 2, ARect.Top, text); End;
Ondriter must be assigned to each Items in the popup menu that you want to attract
Each item will be created separately by calling your OnDrawItem event handler - From OnDrawItem event per item > Parameter is a reference to the specific item to be prepared for that call. You may have a handler that knows how to draw everything, or can use different handlers if the items need different drawing. it occurs.
If this is not working, then I suspect that you have not assigned it to everyone else on an OnDrawItem event handler for any item in your popup menu and after that The original item has been removed from it or in some way it has not been assigned to the handler.
Comments
Post a Comment