⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 control.h

📁 这是VCF框架的代码
💻 H
📖 第 1 页 / 共 3 页
字号:
	/**	*translate the point from this controls coordinate system to	*the parent controls coordinate system	*/	void translateToParent( Point* point );	/**	*translate the point from parent controls coordinate system	*to this controls coordinate system	*/	void translateToLocal( Point* point );	/**	Takes the coordinates in pt, which are in the coordinate system of	this control, and translates them into the coordinate system of the	Screen.	@param Point the initial point value, in the coordinate system of the	control this method is called on.	*/	void translateToScreenCoords( Point* pt );	/**	Takes the coordinates in rect, which are in the coordinate system of	this control, and translates them into the coordinate system of the	Screen.	@param Rect the initial rect value, in the coordinate system of the	control this method is called on.	*/	void translateToScreenCoords( Rect* rect );	/**	Takes the coordinates in pt, which are in the coordinate system of	the Screen, and translates them into the coordinate system of this	control.	@param Point the initial point value, in the coordinate system of the	Screen.	*/	void translateFromScreenCoords( Point* pt );	/**	Takes the coordinates in rect, which are in the coordinate system of	the Screen, and translates them into the coordinate system of this	control.	@param Rect the initial rect value, in the coordinate system of the	Screen.	*/	void translateFromScreenCoords( Rect* rect );	/**	*identifies the control as a lightweight control. Lightweight control's	*do not take up windowing system resources, instead, they rely on all events	*and paint notification be sent to them via their parents. The default return for	*this is false, so only those controls specifically actign as light weight Controls	*need to return true	*/	virtual bool isLightWeight();	/**	*Returns the first parent of the Control that is a heavweight Control, i.e it's isLighweight()	*method return false.	*/	virtual Control* getHeavyweightParent();	/**	*returns the color used to fill the background of this control	*@see CustomControl::setUseColorForBackground	*/	Color* getColor();	/**	*sets the color to fill this control's background with	*/	void setColor( Color* color );	/**	* called just prior to completely destroying the control	* and it's associated memory.	*@see Component::beforeDestroy()	*/	virtual void beforeDestroy( ComponentEvent* event );	/**	* Special initializations may then happen here.	*@see Component::afterCreate()	*/	virtual void afterCreate( ComponentEvent* event );	/**	*Returns the font associated with this control	*/	Font* getFont();	/**	*sets the font attributes. Note the internal font is <b><i>not</i></b>	*reassigned, but rather the data is copied over from the font instance	*passed in to the method.	*The caller completely owns the font instance that is passed in, and is	*responsible for cleaning up it's memory.	*@param Font the font to copy data from in replacing attributes of the	*control's font.	*/	void setFont( Font* font );	/**	*returns whether this control will use the font settings of the	*parent's font.	*@return bool true if the control does use it's parent's font settings	*otherwise false.	*/	bool useParentFont();	/**	*sets whether the control should use it's parent font's settigns or	*use it's own independent of it's parent's font.	*/	void setUseParentFont( const bool& useParentFont );	/**	*repaint the control. This post a message to the windowing systems	*message queue.	*@param Rect a rectangle may be specified indicating the precise	*region of the control that should be repainted. If this is	*NULL, then the entire visible region of the control is repainted	*/	void repaint( Rect* repaintRect=NULL );	void repaintNow( Rect* repaintRect=NULL );	/**	*is this component double buffered.	*@return bool true if the component is double buffered, otherwise	*false.	*/	bool isDoubleBuffered();	/**	*sets whether or not this control is double buffered. A control	*that is double buffered will automatically use a memory graphics	*context to draw on, and then blit the contents of this on the	*actual graphics context for the control. Doing this results in	*completely flicker free drawing of your controls, but is slighty	*slower. Without double buffering, the painting of the control	*takes place directly on the control's graphics context, and can	*result in flicker, but is slighlty faster. Controls have this	*set to true by default, with the exception of the OpenGL control,	*which lets the underlying OpenGL graphics engine take care of	*the double buffering for it.	*@param bool true to enable the double buffered drawing, otherwise	*false	*/	void setDoubleBuffered( const bool& doubleBuffered );	/**	Returns true if the Control should take advantage of the GraphicsContexts'	render buffer for anti-aliased vector graphics (based on the AGG library).	*/	bool isUsingRenderBuffer() {		return (controlState_ & Control::csUseRenderBuffer) ? true : false;	};	/**	sets whether or not the control is using the render buffer of it's	GraphicsContext. Using the render buffer allows the control to	take advantage of the GraphicsContext's advanced anti-aliasing vector	graphics. This will create snapshot image that is retained and used	to draw into. When the drawing is done (i.e. paint() returns), the image	contents are copied back to the actual GraphicsContext. If the	control is resized the image is resized as well	*/	void setUsingRenderBuffer( const bool& useRenderBuffer ) {		if ( useRenderBuffer ) {			controlState_  |= Control::csUseRenderBuffer;		}		else {			controlState_  &= ~Control::csUseRenderBuffer;		}	}	/**	*this keeps the mouse events being sent to this control, even if the	*mouse leaves the physical bounds of the control	*/	void keepMouseEvents();	/**	*releases mouse events - goes back to normal event handling	*/	void releaseMouseEvents();	/**	*return a pointer to the graphics context of the control.	*/	GraphicsContext* getContext();	/**	*returns the Control's PopupMenu, if any.	*The popupmenu will be displayed whenever the user	*right clicks the mouse over the control.	*/	PopupMenu* getPopupMenu();	/**	*sets the popup menu for this control.	*/	void setPopupMenu( PopupMenu* popupMenu );	/**	*returns the view associated with this control	*/	View* getView();	/**	*sets the view to associate with this control	*/	void setView( View* view );	/**	*returns the preferred width for this control. This is used	*when determing the width of the control when it is first created.	*Override it to provide a different value that is more acceptable	*for your control's initial display size.	*/	virtual double getPreferredWidth(){		return 100.0;	};	/**	*returns the preferred height for this control. This is used	*when determing the height of the control when it is first created.	*Override it to provide a different value that is more acceptable	*for your control's initial display size.	*/	virtual double getPreferredHeight() {		return 25.0;	}	/**	*set the preferred width. This is used when determing the height	*of the control when it is first created.	*/	virtual void setPreferredWidth( const double& width ){};	/**	*set the preferred height. This is used when determing the height	*of the control when it is first created.	*/	virtual void setPreferredHeight( const double& height ){};	/**	Returns the minimum size for this control. At the moment this is only	used for Frames, to control the minimum size a user can resize the	Frame to.	@return Size the minimum size. If the width_ field is set equal to 	Control::mmIgnoreMinWidth then the minimum width is ignored. If the 	height_ field is set equal to Control::mmIgnoreMinHeight then the 	minimum height is ignored. 	*/	Size getMinSize() {		return minSize_;	}	/**	Sets the minimum size of the control.	@param Size the minimum size. If the width_ field is set equal to 	Control::mmIgnoreMinWidth then the minimum width is ignored. If the 	height_ field is set equal to Control::mmIgnoreMinHeight then the 	minimum height is ignored.	*/	void setMinSize( const Size& val ) {		minSize_ = val;	}	/**	Returns the minimum width of the control.	@see getMinSize	*/	double getMinWidth() {		return minSize_.width_;	}	/**	Sets the minimum width of the control.	@see setMinSize	*/	void setMinWidth( const double& val ) {		minSize_.width_ = val;	}	/**	Returns the minimum height of the control.	@see getMinSize	*/	double getMinHeight() {		return minSize_.height_;	}	/**	Sets the minimum height of the control.	@see setMinSize	*/	void setMinHeight( const double& val ) {		minSize_.height_ = val;	}	/**	Returns the maximum size for this control. At the moment this is only	used for Frames, to control the maximum size a user can resize the	Frame to.	@return Size the maximum size. If the width_ field is set equal to 	Control::mmIgnoreMaxWidth then the maximum width is ignored. If the 	height_ field is set equal to Control::mmIgnoreMaxHeight then the 	maximum height is ignored. 	*/	Size getMaxSize() {		return maxSize_;	}	/**	Sets the maximum size of the control.	@param Size the maximum size. If the width_ field is set equal to 	Control::mmIgnoreMaxWidth then the maximum width is ignored. If the 	height_ field is set equal to Control::mmIgnoreMaxHeight then the 	maximum height is ignored.	*/	void setMaxSize( const Size& val ) {		maxSize_ = val;	}	double getMaxWidth() {		return maxSize_.width_;	}	void setMaxWidth( const double& val ) {		maxSize_.width_ = val;	}	double getMaxHeight() {		return maxSize_.height_;	}	void setMaxHeight( const double& val ) {		maxSize_.height_ = val;	}	/**	*returns an object implementing the Scrollable interface	*The default value is NULL, indicating the control does not support	*scrolling behaviour	*/	Scrollable* getScrollable() {		return scrollable_;	}	/**	*sets the scrollable for the control. Control's with a	*scrollable object will be able to provide scroll bars	*when neccessary.	*@see Scrollable	*@see Scrollable::setVirtualViewHeight	*@see Scrollable::setVirtualViewWidth	*/	virtual void setScrollable( Scrollable* scrollable );	/**	Call this method to adjust the view bounds (i.e. what the GraphicsContext::getViewableBounds()	method returns) to take into consideration the presence of scroll bars	*/	void adjustViewableBoundsAndOriginForScrollable( GraphicsContext* context, Rect& viewBounds, Point& origin );	/**	*returns a string that is used for context sensitive help	*for the control.	*/	String getWhatsThisHelpString() {		return whatsThisHelpString_;	}	/**	*sets the string that is used for context sensitive help	*for the control.	*/	void setWhatsThisHelpString( const String& whatsThisHelpString ) {		whatsThisHelpString_ = whatsThisHelpString;	}	/**	*returns a string that is used to display in the tooltip	*for the control.	*/	String getToolTipText() {		return toolTip_;	}	/**	*sets the string that is used to display in the tooltip	*for the control.	*/	void setToolTipText( const String& tooltip );	/**	*returns the cursor ID for the control. The cursor id represents an id tag that	*identifies a Cursor object to be used to for controling the display of the	*mouse cursor. To access the Cursor object directly call the CursorManager::getCursor()	*method.	*@return long the id of the cursor	*@see CursorManager	*@see CursorManager::getCursor()	*@see Cursor	*/	long getCursorID() {		return cursorID_;	}	/**	*sets the cursor ID for the control. This will change the	*cursor appearance whenever the mouse is over the control.	*/	void setCursorID( const long& cursorID );	/**	*returns the anchor mask value for this control.	*Anchors allow you to customize the sizing behavior of a particular control.	*Setting the alignment may be done at any time after the control has been instantiated.	*By anchoring a control you can have finer control over how the control gets resized	*when it's parent is resized than simply specifying an alignment value. However,	*changing the anchor value of a control will automatically set the control's alignment	*to ALIGN_NONE, while changing the control's alignment will automatically set the control's	*anchor value to ANCHOR_NONE. The two values are mutually exclusive, you can get one or	*the other, but not both. The following table describes the meanings of the various	*mask values for the anchor value, which can have either the value of ANCHOR_NONE	*or any combination of the other four mask types.	*<table width="100%" cellpadding="2" cellspacing="0" border="1" bordercolor="#C0C0C0">	*<tr>	*<td width="20%" bgcolor="#C0C0C0" valign=TOP>	*Value</td>	*<td width="80%" bgcolor="#C0C0C0" valign=TOP>	*Meaning</td>	*</tr>	*<tr>	* <td width="20%" valign=TOP>	*	<code>ANCHOR_NONE</code></td>	* <td width="80%" valign=TOP>	*   This is the default value for a control's anchor property. No layout	*	adjustments are performed on the control.</td>	*</tr>	*<tr>	* <td width="20%" valign=TOP>	*   <code>ANCHOR_TOP</code></td>	* <td width="80%" valign=TOP>	*   The Control is anchored to the top edge of the parent control it	*	belongs to. Whatever the distance between the top edge and the top	*	coordinate of the control when this is set, is maintained whenever	*	the parent control's dimensions change.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -