1

What on earth is a caret in the context of a CSplitterWnd class? I can't find any documentation relating explicitly to CSplitterWnds...

EDIT: Specifically, what do these functions actually do:

CWnd * pCurView = m_wndSplitter2.GetPane(2, 0);
pCurView->ShowCaret()
pCurView->HideCaret()

EDIT2: Please note, I know what a caret is, I am specifically asking about the functions within the context of the CSlitterWnd Class. I have seen the MSDN documentation and it offers no real explaination.

Aidan Ryan
  • 11,389
  • 13
  • 54
  • 86
Konrad
  • 39,751
  • 32
  • 78
  • 114
  • Should probably retitle this question, the Show/Hide Caret in your example really has nothing to do with CSplitterWnd. ShowCaret is a CWnd member independent of being a CSplitteerWnd pane. – Aidan Ryan Oct 16 '08 at 18:03

6 Answers6

1

It's a caret in the normal sense. Applies only when you're splitting two CEditViews in the same window.

TheSmurf
  • 15,337
  • 3
  • 40
  • 48
1

In the Windows SDK world the cursor is actually the mouse pointer, and the caret is the flashing bar you see in text controls etc...

Sean
  • 60,939
  • 11
  • 97
  • 136
1

Specifically;

CWnd * pCurView = m_wndSplitter2.GetPane(2, 0);

Get a pane, as in a CView derived class, surrounded by your splitter window

pCurView->ShowCaret()

Show the littler vertical bar at the text editing position in that view. This is the cursor used in any text editing control such as a CEdit

pCurView->HideCaret()

Hide the caret / vertical cursor.

SmacL
  • 22,555
  • 12
  • 95
  • 149
1

It's the text cursor.

In early versions of windows, the text cursor was like a proofreader's caret mark (like ^ only on the baseline). This makes some sense, as that mark is what proofreaders use to indicate where text should be inserted.

Still seems bizarre to call it the caret, but they did, possibly because they'd already decided to use the word "cursor" for what everyone else calls the mouse pointer.

Mark Baker
  • 5,588
  • 2
  • 27
  • 25
  • But there is no caret displayed in a CSplitterWnd class!?!? – Konrad Oct 16 '08 at 16:38
  • It has nothing to do with CSplitterWnd. As soon as you call GetPane you've got a pointer to whatever CWnd you happend to create as the pane. The calls to ShowCarent and HideCaret are completely irrelevant to being a CSplitterWnd pane. – Aidan Ryan Oct 16 '08 at 18:41
  • *"In early versions of windows, the text cursor was like a proofreader's caret mark (like ^ only on the baseline)."* Citation needed. Even in Windows 1.01, the text caret looks exactly as it does today: a vertical bar. (See [screenshot of Run dialog](https://guidebookgallery.org/pics/gui/system/features/run/win101-1-1.png).) I don't have a screenshot handy, but I can assure you it looked this way in the beta versions of Windows 1, too. So, I'm not sure what you're remembering here, but I'm relatively certain it isn't true. Write (predecessor to Wordpad) had a weird character there, though. – Cody Gray - on strike Oct 11 '22 at 04:59
1

Any CWnd can have a caret, but only CWnd inheritors that CreateCaret first actually display one. @DannySmurf gives you one example - CEditView - of a CView that creates a caret that you can show and hide.

Depending on the specific kind of CView you've got on your pane, ShowCaret is probably irrelevant. It has nothing to do with CSplitterWnd.

Aidan Ryan
  • 11,389
  • 13
  • 54
  • 86
0

Perhaps they are referring to the cursor, the blinking vertical bar on the screen.

DOK
  • 32,337
  • 7
  • 60
  • 92