Csplitterwnd member introduction and sharding Customization

Source: Internet
Author: User

1. splitter styles)
The csplitterwnd class supports split windows of two different styles.

1.1 static Splitter)

1.2 dynamic split)

Csplitterwnd Member

Base class member

Cobject members

Cve-target members

Cwnd members

Create

Create a dynamic separator window and associate it withCsplitterwndObject connection.

Createstatic

Create a static separator window and associate it withCsplitterwndObject connection.

Createview

Call it to create a pane to a split window.

Csplitterwnd

ConstructCsplitterwndObject.

Getcolumncount

Returns the Count value of the current pane column.

Getcolumninfo

Returns the information of the specified column.

Getpane

Returns the pane at the specified row and column.

Getrowcount

Returns the row list in the current pane.

Getrowinfo

Returns the information of the specified row.

Getscrollstyle

Returns the style of the shared scroll bar.

Idfromrowcol

Returns the Child Window ID of the pane at the specified row and column.

Istracking

Locate the shard. If the Shard is currently being moved.

Ischildpane

Call to determine whether the window is a subpane of the current split window.

Recalclayout

The split window is displayed after the size of the row and column.

Setcolumninfo

Call to set the information of the specified column.

Setrowinfo

Call to set the information of the specified row.

Setscrollstyle

Specify a new scroll bar style for the shared scroll bar of the split window (separator window.

Activatenext

Run the next pane or previous pane command.

Canactivatenext

Check whether the next pane or previous pane command is currently available.

Createscrollbarctrl

Create a control ).

Deletecolumn

Delete a column from the split window.

Deleterow

Delete a row from the split window.

Deleteview

Delete A View from the split window.

Dokeyboardsplit

Execute the keyboard scroll command, usually "window split ."

Doscroll

Execute the split window to synchronously scroll.

Doscrollby

Scroll the split window by the given number of shards.

Getactivepane

Determine the activity pane, depending on the focus or view in the framework.

Ondrawsplitter

Depicts an image to a split window.

Oninverttracker

Depicts an image to a split window, which is the same size and shape as the frame window.

Setactivepane

Set a pane that is active in the framework.

Splitcolumn

Indicates whether a frame window is vertically split.

Splitrow

Indicates whether a frame window is horizontally split.

 

 

 

 

Terminology used by implement)
Csplitterwnd (split form ):
Provides the pane split space and the scroll bar (ROW) share the vertical scrollbar), and the horizontal scroll bar (horizontal scrollbar) for the same column. At the same time, the subscript of the row and column is from 0, start from 0, that is, the first window is the pane of 0th columns in 0th rows

Pane (PANE)
Application of csplitterwnd ManagementProgramDisplay the data form. Generally, the pane is a derived class object of a view. In fact, the pane can be any object derived from cwnd;

Splitter bar (split control bar)
Controls between rows and columns in a pane to control the size of the upper pane of a row or column.

Spliiter box (split grid)
The button that dynamically splits the form at the top of the vertical scroll bar or the leftmost position of the horizontal scroll bar to create a new split pane.

Splitter Intersection)
Vertical or horizontal split control bar intersection, can be used for Synchronous Control of horizontal, vertical Pane size

4. Shared scroll bars)

 

Lock shard
After creating a split window, you do not want to adjust the size of the window by dragging the split bar. In this case, you must lock the shard. The simplest way to lock the Shard is to prevent csplitterwnd from processing wm_lbuttondown, wm_mousemove, and wm_setcursor messages. Instead, these messages are sent to the cwnd window for processing, thus blocking these messages. Take the wm_lbuttondown process as an example. To:
Void cxxsplitterwnd: onlbuttondown (uint nflags, cpoint point)
{
Cwnd: onlbuttondown (nflags, point );
}

sharding customization
the sharding entries generated by the window are always fixed without any changes, when we use some software such as ACDSee, we can find that the sharding is different from the automatically generated sharding. How can we customize sharding? This can be achieved by reloading the Virtual Methods ondrawsplitter and oninverttracker of csplitterwnd. The following Code generates the result that the border color of the split window is red and the color of the split bar is green. the Code is as follows:

Void csplitterwndex: ondrawsplitter (CDC * PDC, esplittype ntype, const crect & rectarg) {If (PDC = NULL) {redrawwindow (rectarg, null, rdw_invalidate | rdw_nochildren ); return;} assert_valid (PDC); crect rc = rectarg; Switch (ntype) {Case splitborder: // redraw the border of the split window to make it red PDC-> draw3drect (RC, RGB (255, 0, 0), RGB (255, 0, 0); RC. inflaterect (-cx_border,-cy_border); PDC-> draw3drect (RC, RGB (255, 0), RGB (255, 0); return; c ASE splitbox: PDC-> draw3drect (RC, RGB (0, 0), RGB (0, 0); RC. inflaterect (-cx_border,-cy_border); PDC-> draw3drect (RC, RGB (0, 0), RGB (0, 0); RC. inflaterect (-cx_border,-cy_border); PDC-> fillsolidrect (RC, RGB (0, 0); PDC-> draw3drect (RC, RGB (0, 0, 0 ), RGB (255,255,255, 0); return; Case splitbar: // redraw the split string to green PDC-> fillsolidrect (RC, RGB (); RC. inflaterect (-5,-5); PDC-> draw3drect (RC, RGB (255, 0), RGB (255, 0, 0) ); Return; default: assert (false);} PDC-> fillsolidrect (RC, RGB (255,);} void csplitterwndex: oninverttracker (crect & rect) {assert_valid (this); Assert (! Rect. isrectempty (); Assert (getstyle () & ws_clipchildren) = 0); crect rc = rect; RC. inflaterect (2, 2); CDC * PDC = getdc (); cbrush * pbrush = CDC: gethalftonebrush (); hbrush holdbrush = NULL; If (pbrush! = NULL) holdbrush = (hbrush) SelectObject (PDC-> m_hdc, pbrush-> m_hobject); PDC-> patblt (RC. left, RC. top, RC. width (), RC. height (), blackness); If (holdbrush! = NULL) SelectObject (PDC-> m_hdc, holdbrush); releasedc (PDC );}

similarly, we only need to inherit some other virtual methods in csplitterwnd to generate a split window with our own personality.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.