21static void setWindowLayoutMetrics(TLayoutMetrics& lm, TNoteTab* tab,
33 lm.Width.RightOf(tab);
81 LPCTSTR text = titles ? titles : wnd.
GetCaption();
119 ::MapWindowPoints(HWND_DESKTOP, *parent, LPPOINT(&tRect), 2);
122 ::MapWindowPoints(HWND_DESKTOP, *parent, LPPOINT(&pgRect), 2);
123 pgRect.left = pgRect.top = 0;
130 if(pgRect.right > tRect.left)
131 pgRect.right = tRect.left;
137 if(pgRect.bottom > tRect.top)
138 pgRect.bottom = tRect.top;
141 page.
SetWindowPos(HWND_TOP, pgRect, SWP_NOACTIVATE|SWP_NOREDRAW|SWP_NOZORDER);
150 for(
int i = 0; i< count; i++){
161 if(Item.
Label.empty()){
197 PRECONDITION(index >= 0 && index < NoteTab->GetCount());
200 if (
const auto currentPage =
GetPage())
201 currentPage->ShowWindow(SW_HIDE);
203 const auto newPage =
GetPage();
204 newPage->ShowWindow(SW_SHOWNORMAL);
212 w->ShowWindow(SW_SHOWNORMAL);
218 w->ShowWindow(SW_HIDE);
243void TTabbedWindow::Init()
254 for(i = 0; i < count; i++){
304 for(i = 0; i < count; i++)
321 return Add(*wnd1, titles);
331 int index =
Add(*wnd1, titles);
353 for(
uint i = 0; i < count; i++){
400TTabbedView::VnIsWindow(HWND hWnd)
#define PRECONDITION(condition)
static const TColor Transparent
a non-painting color
When specifying the layout metrics for a window, four layout constraints are needed.
TEdgeConstraint Y
Y contains the Y (top, center, bottom) edge constraint of the window.
TEdgeOrWidthConstraint Width
Contains the width size constraint, center edge constraint, or right edge (lmRight) constraint of the...
TEdgeOrHeightConstraint Height
Contains the height size constraint, center edge constraint, or bottom edge constraint of the window.
void SetMeasurementUnits(TMeasurementUnits units)
TEdgeConstraint X
X contains the X (left, center, right) edge constraint of the window.
Derived from TWindow, TLayoutWindow provides functionality for defining the layout metrics for a wind...
TLayoutWindow(TWindow *parent, LPCTSTR title=0, TModule *module=0)
Creates a TLayoutWindow object with specified parent, window caption, and library ID.
virtual void Layout()
Causes the window to resize and position its children according to the specified metrics.
bool GetChildLayoutMetrics(const TWindow &child, TLayoutMetrics &metrics)
Gets the layout metrics of the child window.
void SetChildLayoutMetrics(TWindow &child, const TLayoutMetrics &metrics)
Sets the metrics for the window and removes any existing ones.
ObjectWindows dynamic-link libraries (DLLs) construct an instance of TModule, which acts as an object...
TNoteTab encapsulates a tab control with each tab item along the bottom of the window.
TNotify is a thin wrapper around the NMHDR structure.
TPoint()
Constructs an uninitialized point.
TRect is a mathematical class derived from tagRect.
int Height() const
Returns the height of this rectangle (bottom - top).
int Width() const
Returns the width of this rectangle (right - left).
TTabbedBase implements a tabbed window, designed to be mixed in with TWindow derived.
virtual void AdjustPage(TWindow &page)
TTabbedBase(TWindow *self, int x, int y, int w, int h, TTabPosition=tpBottom, TNoteTab *tab=0)
int Add(TWindow &wnd, LPCTSTR titles=0)
Add a new tab page.
void EvTabControlSelChange(TNotify &tcn)
void SelectPage(int index, bool shouldFocusPage=true)
Hides the current page and shows the page at the given index.
TWindow * GetPage(int index=-1)
TNoteTab * GetTabControl()
bool EvTabControlSelChanging(TNotify &tcn)
TTabbedView(TDocument &doc, TWindow *parent=0)
Tabbed windows it is used in tabbed window.
bool DeletePage(TWindow &wnd)
TTabbedWindow(TWindow *parent=0, LPCTSTR title=0, TModule *module=0)
int AddPage(TWindow &wnd, LPCTSTR titles=0)
Add a new tab page.
void ResizeTabControl(int newHeight)
Sets the height of the tab control to the given value, then updates the layout of the window and inva...
friend class TDocument
needs access to NextView
TView(TDocument &doc)
Constructs a TView object of the document associated with the view.
TWindow, derived from TEventHandler and TStreamableBase, provides window-specific behavior and encaps...
TApplication * GetApplication() const
Gets a pointer to the TApplication object associated with this.
void SetBkgndColor(TColor color, bool shouldUpdate=true)
Sets the background color for the window.
bool SetWindowPos(HWND hWndInsertAfter, const TRect &rect, uint flags)
Changes the size of the window pointed to by rect.
virtual bool Create()
Creates the window interface element to be associated with this ObjectWindows interface element.
TWindow * GetParentO() const
Return the OWL's parent for this window.
bool IsWindow() const
Returns true if an HWND is being used.
int GetWindowText(TCHAR *str, int maxCount) const
Copies the window's title into a buffer pointed to by string.
bool IsChild(HWND hWnd) const
Returns true if the window is a child window or a descendant window of this window.
void GetWindowRect(TRect &rect) const
Gets the screen coordinates of the window's rectangle and copies them into rect.
bool ModifyStyle(uint32 offBits, uint32 onBits, uint swpFlags=0)
Modifies the style bits of the window.
LPCTSTR GetCaption() const
Returns the Title member of TWindow.
virtual bool ShowWindow(int cmdShow)
Displays this TWindow in a given state.
virtual void Invalidate(bool erase=true)
Invalidates (mark for painting) the entire client area of a window.
HWND GetHandle() const
Returns the handle of the window.
Definition of class TDocManager.
#define DEFINE_RESPONSE_TABLE2(cls, base1, base2)
Macro to define a response table for a class with two bases.
#define DEFINE_RESPONSE_TABLE1(cls, base)
Macro to define a response table for a class with one base.
#define lmParent
Use to represent the parent in layout metrics.
@ lmTop
The top edge of the window.
@ lmBottom
The bottom edge of the window.
@ lmRight
The right edge of the window.
@ lmLeft
The left edge of the window.
int Add(LPCTSTR txt, INT_PTR clientData=0, int imageIdx=-1, TAbsLocation imageLoc=alLeft, bool shouldSelect=true)
Adds a new tabitem to the notetab control.
int GetSel() const
Returns the index of the selected tabitem.
INT_PTR ClientData
User-defined data associated with item.
bool GetItem(int index, TNoteTabItem &item) const
Retrieve information about the tab item at the specified index.
int SetSel(int index)
Selects the tabitem at the specified index.
TNoteTab(TWindow *parent, int id, int x, int y, int w, int h, TWindow *buddy=0, bool dialogBuddy=true, TModule *module=0)
Constructor of NoteTab object.
bool Delete(int index)
Remove the tabitem at the specified 'index'.
bool SetItem(int index, const TNoteTabItem &item)
Updates information about the tab item at the specified index.
int GetCount() const
Return the number of tab items in the notetab control.
tstring Label
Label of tab.
int GetMinimalHeight()
Returns the minimal control height for which tabs are not clipped.
Definition of classes TLayoutMetrics & TLayoutWindow.
Object Windows Library (OWLNext Core).
EV_TCN_SELCHANGING(IDC_TABCONTROL, EvTabControlSelChanging)
EV_TCN_SELCHANGE(IDC_TABCONTROL, EvTabControlSelChange)
General definitions used by all ObjectWindows programs.
#define TYPESAFE_DOWNCAST(object, toClass)
void SameAs(TWindow *otherWin, TEdge edge)
Sets the edge of your window indicated by edge equivalent to the corresponding edge of the window in ...
void Set(TEdge edge, TRelationship rel, TWindow *otherWin, TEdge otherEdge, int value=0)
For setting arbitrary edge constraints.
void SameAs(TWindow *otherWin, TEdge edge)
void Absolute(TEdge edge, int value)
void Absolute(TEdge edge, int value)
void SameAs(TWindow *otherWin, TEdge edge)
TMeasurementUnits Units
Units enumerates the units of measurement (either pixels or layout units) used to measure the height ...
TNoteTabItem holds information about each tab in a notetab control.
Class definition for TTabbedBase .