Einzelnen Beitrag anzeigen

Aviator

Registriert seit: 3. Jun 2010
1.611 Beiträge
 
Delphi 10.3 Rio
 
#5

AW: VirtualStringTree Item selektieren Problem beim Zeichnen

  Alt 19. Aug 2016, 18:45
Hast du denn auch in den TreeOptions.PaintOptions den Schalter toHideSelection und toAlwaysHideSelection ausgeschaltet? Andernfalls wird keine Selection gezeichnet. Die sind zwar standardmäßig aus, aber ich weiß ja nicht, was du alles ausprobiert hast.

Du solltest auch das toShowStaticText rausnehmen. Was bezweckst du überhaupt damit? Du schränkst dich dadurch nur unnötig ein. So wie ich es weiß (und so steht es auch in der Hilfe) kann man StaticText nicht selektieren. Ob es daran jetzt schlussendlich liegt kann ich dir nicht sagen. Habe gerade kein Delphi zur Hand.

Zitat von VirtualStringTree Help:
Static text: All text that you return when TextType is ttStatic will be displayed right beside the normal text (or left to it if the column's BidiMode is not bdLeftToRight, i.e. the column has right-to-left layout). Static text is used only for informational purposes; it cannot be selected or dragged and if the column is not wide enough to show all text it will not be shortened with an ellipsis (...) as normal text. The string tree will only query for static text if the StringOptions (see TreeOptions) include toShowStaticText. This is off by default.

[...]


Description
Use other resources like the news group or the Delphi Gems message board to find a description.

MembersDescription
ttNormalnormal label of the node, this is also the text which can be edited
ttStaticstatic (non-editable) text after the normal text
Wenn ich das OnPaintText Event bei mir implementiere ist es so (wenn ich mich jetzt nicht absolut täusche), dass nur die Eigenschaften des Textes verändert werden wenn man im TargetCanvas.Font.XXX etwas ändert. Das Rect in dem gezeichnet wird muss man nicht mehr füllen oder sonst was machen. Alternativ zum OnPaintText Event gibt es auch noch das OnDrawText Event in dem der Parameter DefaultDraw auf false gesetzt werden kann. Dann muss man aber alles selbst machen.
  Mit Zitat antworten Zitat