struct UNLESS_MERGELIBS_MORE(VCL_DLLPUBLIC) ControlLayoutData
{ // contains the string really displayed // there must be exactly one bounding rectangle in m_aUnicodeBoundRects // for every character in m_aDisplayText
OUString m_aDisplayText; // the bounding rectangle of every character // where one character may consist of many glyphs
std::vector< tools::Rectangle > m_aUnicodeBoundRects; // start indices of lines
std::vector< tools::Long > m_aLineIndices; // notify parent control on destruction
VclPtr<const Control> m_pParent;
ControlLayoutData();
~ControlLayoutData();
tools::Rectangle GetCharacterBounds( tools::Long nIndex ) const; // returns the character index for corresponding to rPoint (in control coordinates) // -1 is returned if no character is at that point
tools::Long GetIndexForPoint( const Point& rPoint ) const; // returns the interval [start,end] of line nLine // returns [-1,-1] for an invalid line
::Pair GetLineStartEnd( tools::Long nLine ) const; /** ToRelativeLineIndex changes a layout data index to a count relative to its line.
class VCL_DLLPUBLIC Control : public vcl::Window
{ protected: mutable std::optional<vcl::ControlLayoutData> mxLayoutData;
VclPtr<OutputDevice> mpReferenceDevice;
/// creates the mpData->mpLayoutData structure
SAL_DLLPRIVATE void CreateLayoutData() const; /// determines whether we currently have layout data
SAL_DLLPRIVATE bool HasLayoutData() const;
/** this calls both our event listeners, and a specified handler
virtualbool FocusWindowBelongsToControl(const vcl::Window* pFocusWin) const; public:
SAL_DLLPRIVATE void ImplClearLayoutData() const; /** draws a frame around the give rectangle, onto the given device
// invalidates layout data virtualvoid SetText( const OUString& rStr ) override; // gets the displayed text virtual OUString GetDisplayText() const override; // returns the bounding box for the character at index nIndex (in control coordinates)
tools::Rectangle GetCharacterBounds( tools::Long nIndex ) const; // returns the character index for corresponding to rPoint (in control coordinates) // -1 is returned if no character is at that point
tools::Long GetIndexForPoint( const Point& rPoint ) const; // returns the interval [start,end] of line nLine // returns [-1,-1] for an invalid line
Pair GetLineStartEnd( tools::Long nLine ) const; /** ToRelativeLineIndex changes a layout data index to a count relative to its line.
/** sets a reference device used for rendering control text @seeDrawControlText
*/ void SetReferenceDevice( OutputDevice* _referenceDevice );
OutputDevice* GetReferenceDevice() const;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.