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

📄 ceguilistheader.h

📁 OGRE开发包的依赖包
💻 H
📖 第 1 页 / 共 2 页
字号:

	/*!
	\brief
		Add a new column segment to the end of the header.

	\param text
		String object holding the initial text for the new segment

	\param id
		Client specified ID code to be assigned to the new segment.

	\param width
		UDim describing the initial width of the new segment.

	\return
		Nothing.
	*/
	void	addColumn(const String& text, uint id, const UDim& width);


	/*!
	\brief
		Insert a new column segment at the specified position.

	\param text
		String object holding the initial text for the new segment

	\param id
		Client specified ID code to be assigned to the new segment.

    \param width
        UDim describing the initial width of the new segment.

	\param position
		Zero based column index indicating the desired position for the new column.  If this is greater than
		the current number of columns, the new segment is added to the end if the header.

	\return
		Nothing.
	*/
	void	insertColumn(const String& text, uint id, const UDim& width, uint position);


	/*!
	\brief
		Insert a new column segment at the specified position.

	\param text
		String object holding the initial text for the new segment

	\param id
		Client specified ID code to be assigned to the new segment.

    \param width
        UDim describing the initial width of the new segment.

	\param position
		ListHeaderSegment object indicating the insert position for the new segment.  The new segment will be
		inserted before the segment indicated by \a position.

	\return
		Nothing.

	\exception InvalidRequestException	thrown if ListHeaderSegment \a position is not attached to the ListHeader.
	*/
	void	insertColumn(const String& text, uint id, const UDim& width, const ListHeaderSegment& position);


	/*!
	\brief
		Removes a column segment from the ListHeader.

	\param column
		Zero based column index indicating the segment to be removed.

	\return
		Nothing.

	\exception InvalidRequestException	thrown if \a column is out of range.
	*/
	void	removeColumn(uint column);


	/*!
	\brief
		Remove the specified segment from the ListHeader.

	\param segment
		ListHeaderSegment object that is to be removed from the ListHeader.

	\return
		Nothing.

	\exception InvalidRequestException	thrown if \a segment is not attached to this ListHeader.
	*/
	void	removeSegment(const ListHeaderSegment& segment);


	/*!
	\brief
		Moves a column segment into a new position.

	\param column
		Zero based column index indicating the column segment to be moved.

	\param position
		Zero based column index indicating the new position for the segment.  If this is greater than the current number of segments,
		the segment is moved to the end of the header.

	\return
		Nothing.

	\exception InvalidRequestException thrown if \a column is out of range for this ListHeader.
	*/
	void	moveColumn(uint column, uint position);


	/*!
	\brief
		Move a column segment to a new position.

	\param column
		Zero based column index indicating the column segment to be moved.

	\param position
		ListHeaderSegment object indicating the new position for the segment.  The segment at \a column
		will be moved behind segment \a position (that is, segment \a column will appear to the right of
		segment \a position).

	\return
		Nothing.

	\exception InvalidRequestException thrown if \a column is out of range for this ListHeader, or if \a position
		is not attached to this ListHeader.
	*/
	void	moveColumn(uint column, const ListHeaderSegment& position);


	/*!
	\brief
		Moves a segment into a new position.

	\param segment
		ListHeaderSegment object that is to be moved.

	\param position
		Zero based column index indicating the new position for the segment.  If this is greater than the current number of segments,
		the segment is moved to the end of the header.

	\return
		Nothing.

	\exception InvalidRequestException thrown if \a segment is not attached to this ListHeader.
	*/
	void	moveSegment(const ListHeaderSegment& segment, uint position);


	/*!
	\brief
		Move a segment to a new position.

	\param segment
		ListHeaderSegment object that is to be moved.

	\param position
		ListHeaderSegment object indicating the new position for the segment.  The segment \a segment
		will be moved behind segment \a position (that is, segment \a segment will appear to the right of
		segment \a position).

	\return
		Nothing.

	\exception InvalidRequestException thrown if either \a segment or \a position are not attached to this ListHeader.
	*/
	void	moveSegment(const ListHeaderSegment& segment, const ListHeaderSegment& position);


	/*!
	\brief
		Set the current base segment offset.  (This implements scrolling of the header segments within
		the header area).

	\param offset
		New base offset for the first segment.  The segments will of offset to the left by the amount specified.
		\a offset should be specified using the active metrics system for the ListHeader.

	\return
		Nothing.
	*/
	void	setSegmentOffset(float offset);


	/*!
	\brief
		Set the width of the specified column.

	\param column
		Zero based column index of the segment whose width is to be set.

	\param width
		UDim value specifying the new width to set for the ListHeaderSegment at the zero based column
		index specified by \a column.

	\return
		Nothing

	\exception InvalidRequestException	thrown if \a column is out of range.
	*/
	void	setColumnWidth(uint column, const UDim& width);


	/*************************************************************************
		Construction and Destruction
	*************************************************************************/
	/*!
	\brief
		Constructor for the list header base class.
	*/
	ListHeader(const String& type, const String& name);


	/*!
	\brief
		Destructor for the list header base class.
	*/
	virtual ~ListHeader(void);


protected:
	/*************************************************************************
		Abstract Implementation Methods
	*************************************************************************/
	/*!
	\brief
		Create and return a pointer to a new ListHeaderSegment based object.

	\param name
		String object holding the name that should be given to the new Window.

	\return
		Pointer to an ListHeaderSegment based object of whatever type is appropriate for
		this ListHeader.
	*/
	//virtual ListHeaderSegment*	createNewSegment_impl(const String& name) const	= 0;


	/*!
	\brief
		Cleanup and destroy the given ListHeaderSegment that was created via the
		createNewSegment method.

	\param segment
		Pointer to a ListHeaderSegment based object to be destroyed.

	\return
		Nothing.
	*/
	//virtual void	destroyListSegment_impl(ListHeaderSegment* segment) const = 0;


	/*************************************************************************
		Implementation Methods
	*************************************************************************/
	/*!
	\brief
		Create initialise and return a ListHeaderSegment object, with all events subscribed and ready to use.
	*/
	ListHeaderSegment*	createInitialisedSegment(const String& text, uint id, const UDim& width);


	/*!
	\brief
		Layout the attached segments
	*/
	void	layoutSegments(void);


	/*!
	\brief
		Return whether this window was inherited from the given class name at some point in the inheritance hierarchy.

	\param class_name
		The class name that is to be checked.

	\return
		true if this window was inherited from \a class_name. false if not.
	*/
	virtual bool	testClassName_impl(const String& class_name) const
	{
		if (class_name=="ListHeader")	return true;
		return Window::testClassName_impl(class_name);
	}


    /*!
    \brief
        Create and return a pointer to a new ListHeaderSegment based object.

    \param name
        String object holding the name that should be given to the new Window.

    \return
        Pointer to an ListHeaderSegment based object of whatever type is appropriate for
        this ListHeader.
    */
    ListHeaderSegment*  createNewSegment(const String& name) const;


    /*!
    \brief
        Cleanup and destroy the given ListHeaderSegment that was created via the
        createNewSegment method.

    \param segment
        Pointer to a ListHeaderSegment based object to be destroyed.

    \return
        Nothing.
    */
    void    destroyListSegment(ListHeaderSegment* segment) const;

    // validate window renderer
    virtual bool validateWindowRenderer(const String& name) const
    {
        return (name == "ListHeader");
    }

	/*************************************************************************
		New List header event handlers
	*************************************************************************/
	/*!
	\brief
		Handler called when the sort column is changed.
	*/
	virtual	void	onSortColumnChanged(WindowEventArgs& e);


	/*!
	\brief
		Handler called when the sort direction is changed.
	*/
	virtual	void	onSortDirectionChanged(WindowEventArgs& e);


	/*!
	\brief
		Handler called when a segment is sized by the user.  e.window points to the segment.
	*/
	virtual	void	onSegmentSized(WindowEventArgs& e);


	/*!
	\brief
		Handler called when a segment is clicked by the user.  e.window points to the segment.
	*/
	virtual	void	onSegmentClicked(WindowEventArgs& e);


	/*!
	\brief
		Handler called when a segment splitter / sizer is double-clicked.  e.window points to the segment.
	*/
	virtual	void	onSplitterDoubleClicked(WindowEventArgs& e);


	/*!
	\brief
		Handler called when the segment / column order changes.
	*/
	virtual	void	onSegmentSequenceChanged(WindowEventArgs& e);


	/*!
	\brief
		Handler called when a new segment is added to the header.
	*/
	virtual	void	onSegmentAdded(WindowEventArgs& e);


	/*!
	\brief
		Handler called when a segment is removed from the header.
	*/
	virtual	void	onSegmentRemoved(WindowEventArgs& e);


	/*!
	\brief
		Handler called then setting that controls the users ability to modify the search column & direction changes.
	*/
	virtual	void	onSortSettingChanged(WindowEventArgs& e);


	/*!
	\brief
		Handler called when the setting that controls the users ability to drag and drop segments changes.
	*/
	virtual	void	onDragMoveSettingChanged(WindowEventArgs& e);


	/*!
	\brief
		Handler called when the setting that controls the users ability to size segments changes.
	*/
	virtual	void	onDragSizeSettingChanged(WindowEventArgs& e);


	/*!
	\brief
		Handler called when the base rendering offset for the segments (scroll position) changes.
	*/
	virtual	void	onSegmentOffsetChanged(WindowEventArgs& e);

	/*************************************************************************
		handlers for events we subscribe to from segments
	*************************************************************************/
	bool	segmentSizedHandler(const EventArgs& e);
	bool	segmentMovedHandler(const EventArgs& e);
	bool	segmentClickedHandler(const EventArgs& e);
	bool	segmentDoubleClickHandler(const EventArgs& e);
	bool	segmentDragHandler(const EventArgs& e);


	/*************************************************************************
		Implementation Data
	*************************************************************************/
	typedef	std::vector<ListHeaderSegment*>		SegmentList;
	SegmentList	d_segments;			//!< Attached segment windows in header order.
	ListHeaderSegment*	d_sortSegment;	//!< Pointer to the segment that is currently set as the sork-key,
	bool	d_sizingEnabled;		//!< true if segments can be sized by the user.
	bool	d_sortingEnabled;		//!< true if the sort criteria modifications by user are enabled (no sorting is actuall done)
	bool	d_movingEnabled;		//!< true if drag & drop moving of columns / segments is enabled.
	uint	d_uniqueIDNumber;		//!< field used to create unique names.
	float	d_segmentOffset;		//!< Base offset used to layout the segments (allows scrolling within the window area)
	ListHeaderSegment::SortDirection	d_sortDir;		//!< Brief copy of the current sort direction.


private:
	/*************************************************************************
		Static Properties for this class
	*************************************************************************/
	static ListHeaderProperties::SortSettingEnabled		d_sortSettingProperty;
	static ListHeaderProperties::ColumnsSizable			d_sizableProperty;
	static ListHeaderProperties::ColumnsMovable			d_movableProperty;
	static ListHeaderProperties::SortColumnID			d_sortColumnIDProperty;
	static ListHeaderProperties::SortDirection			d_sortDirectionProperty;


	/*************************************************************************
		Private methods
	*************************************************************************/
	void	addHeaderProperties(void);
};


} // End of  CEGUI namespace section


#if defined(_MSC_VER)
#	pragma warning(pop)
#endif

#endif	// end of guard _CEGUIListHeader_h_

⌨️ 快捷键说明

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