9#if !defined(OWL_LISTBOXVIEW_H)
10#define OWL_LISTBOXVIEW_H
13#if defined(BI_HAS_PRAGMA_ONCE)
19#include <owl/listboxview.rh>
39 auto SetDocTitle(LPCTSTR docname,
int index) ->
bool override;
50 auto Create() ->
bool override;
109 return _T(
"List View");
125 return static_cast<TWindow*
>(
this);
146 (Doc->NextView(
this) ||
147 Doc->NextView(
nullptr) !=
this ||
192 return DirtyFlag != 0;
virtual int AddString(LPCTSTR str)
Adds str to the list box, returning its position in the list (0 is the first position).
TListBox(TWindow *parent, int id, int x, int y, int w, int h, TModule *module=0)
Constructs a list box object with the supplied parent window (parent) library ID (module),...
Provides views for list boxes.
bool LoadData(int top, int sel)
Reads the view from the stream and closes the file.
bool VnDocClosed(int omode)
Indicates that the document has been closed.
void CmEditClear()
Automatically responds to a menu selection with a menu ID of CM_EDITCLEAR by clearing the items in th...
void CmEditCopy()
Automatically responds to a menu selection with a menu ID of CM_EDITCOPY and copies the selected text...
void SetExtent(const tstring &str)
Sets the maximum horizontal extent for the list view window.
auto GetViewName() -> LPCTSTR override
Overrides TView's virtual GetViewName function and returns the descriptive name of the class (StaticN...
void CmEditAdd()
Automatically responds to CM_LISTADD message by getting the length of the input string and inserting ...
void CmEditItem()
Automatically responds to a CM_LISTEDIT message by getting the input text and inserting the text into...
auto SetDocTitle(LPCTSTR docname, int index) -> bool override
Overrides TView's virtual SetDocTitle function and stores the document title.
auto AddString(LPCTSTR) -> int override
< String-aware overload
bool VnIsDirty()
Returns a nonzero value if changes made to the data in the view have not been saved to the document; ...
void CmEditCut()
Automatically responds to a menu selection with a menu ID of CM_EDITCUT by calling CmEditCopy and CmE...
bool VnRevert(bool clear)
Indicates if changes made to the view should be erased, and if the data from the document should be r...
void CmSelChange()
Automatically responds to a LBN_SELCHANGE message (which indicates that the contents of the list view...
void CmEditPaste()
Automatically responds to a menu selection with a menu ID of CM_EDITPASTE by inserting text into the ...
int GetMaxWidth() const
Returns the maximum width of the strings.
TListBoxView(TDocument &doc, TWindow *parent=0)
Creates a TListBoxView object associated with the specified document and parent window.
void SetMaxWidth(int maxwidth)
Sets the maximum width of the strings.
void CmEditDelete()
Automatically responds to a menu selection with a menu ID of CM_EDITDELETE by deleting the currently ...
void CmEditUndo()
Handler to undo the last operation performed on the underlying ListBox.
bool VnCommit(bool force)
Commits changes made in the view to the document.
bool VnIsWindow(HWND hWnd)
Returns a nonzero value if the window's handle passed in hWnd is the same as that of the view's displ...
long GetOrigin() const
Returns the origin position on the persistent stream.
uint EvGetDlgCode(const MSG *)
Overrides TWindow's response to a WM_GETDLGCODE message (an input procedure associated with a control...
auto CanClose() -> bool override
Return true if both the listbox and the document can close.
auto GetWindow() -> TWindow *override
Overrides TView's virtual GetWindow function and returns the list view object as a TWindow.
static LPCTSTR StaticName()
put in resource
void SetOrigin(long origin)
Sets the position of the object.
auto Create() -> bool override
Overrides TWindow::Create and creates the view's window.
virtual bool SetDocTitle(LPCTSTR docname, int index)
Stores the document title.
friend class TDocument
needs access to NextView
TView(TDocument &doc)
Constructs a TView object of the document associated with the view.
virtual LPCTSTR GetViewName()=0
Pure virtual function that returns 0.
virtual TWindow * GetWindow()
Returns the TWindow instance associated with the view, or 0 if no view exists.
TWindow, derived from TEventHandler and TStreamableBase, provides window-specific behavior and encaps...
virtual bool SetDocTitle(LPCTSTR docname, int index)
Default behavior for updating document title is to pass it to parent frame.
virtual bool CanClose()
Use this function to determine if it is okay to close a window.
HWND GetHandle() const
Returns the handle of the window.
Definition of class TDocManager.
#define DECLARE_STREAMABLE_OWL(cls, ver)
#define DECLARE_STREAMABLE_INLINES(cls)
Definition of class TListBox and TlistBoxData.
Object Windows Library (OWLNext Core).