9#if !defined(OWL_FRAMEWIN_H)
13#if defined(BI_HAS_PRAGMA_ONCE)
99 LPCTSTR title =
nullptr,
101 bool shrinkToClient =
false,
108 bool shrinkToClient =
false,
114 std::unique_ptr<TWindow> client =
nullptr,
115 bool shrinkToClient =
false,
124 virtual bool SetMenu(HMENU newMenu);
161 auto IdleAction(
long idleCount) ->
bool override;
162 auto HoldFocusHWnd(HWND hWndLose, HWND hWndGain) ->
bool override;
163 auto SetDocTitle(LPCTSTR docname,
int index) ->
bool override;
171 void Init(
TWindow* clientWnd,
bool shrinkToClient);
211 bool KeyboardHandling;
241 bool ResizeClientWindow(
bool redraw =
true);
267 HWND hWndReceiver,
int position)
273 if (::GetMenuItemID(HMenu, Position) ==
uint(-1))
352 return KeyboardHandling;
361 KeyboardHandling = kh;
382 return HWndRestoreFocus;
390 HWndRestoreFocus = hwndrestorefocus;
398 return DocTitleIndex;
406 DocTitleIndex = index;
422 MergeModule =
module;
Descriptor of Bar Implementation.
Base class for an extensible interface for auto enabling/disabling of commands (menu items,...
uint Flags
TCommandStatus flags Is TCommandStatus::WasHandled if the command enabler has been handled.
virtual void SetText(LPCTSTR text)=0
Changes the text associated with a command sender; for example, text associated with a menu item or t...
TCommandEnabler(uint id, HWND hWndReceiver=0)
Constructs the TCommandEnabler object with the specified command ID.
@ NonSender
Command does not generate WM_COMMAND messages.
Derived from TWindow, TFrameWindow controls such window-specific behavior as keyboard navigation and ...
auto IdleAction(long idleCount) -> bool override
Overrides TWindow's virtual function.
void Init(TWindow *clientWnd, bool shrinkToClient)
Normal initialization of a default constructed TFrameWindow.
void SetDocTitleIndex(int index)
Sets the current document's title index.
void EnableKBHandler()
Sets the keyboard handling flag to true.
virtual bool MergeMenu(const TMenuDescr &childMenuDescr)
Merges the given menu descriptor with this frame's own menu descriptor and displays the resulting men...
HICON GetIconSm() const
Retrieve handle of icon of frame window.
virtual TWindow * GetClientWindow()
Returns a pointer to the client window.
virtual bool MergeBar(const TBarDescr &childBarDescr)
Do nothing. Return false. Overriden in TDecoratedFrame.
void EvSize(uint sizeType, const TSize &size)
Response method for an incoming WM_SIZE message.
auto SetDocTitle(LPCTSTR docname, int index) -> bool override
Overrides TWindow's virtual function.
void EvCommandEnable(TCommandEnabler &) override
Handle WM_COMMAND_ENABLE to provide command enable distribution and default support for windows witho...
virtual bool RestoreBar()
Do nothing in TFrameWindow. Overriden in TDecoratedFrame.
virtual bool SetMenu(HMENU newMenu)
Overrides TWindow's non-virtual SetMenu function, thus allowing derived classes the opportunity to im...
HWND GetHWndRestoreFocus()
Returns the handle of the window to restore the focus to.
void SetMenuDescr(const TMenuDescr &menuDescr)
Sets the menu descriptor to the new menu descriptor.
void CleanupWindow() override
Cleans up any associated icons.
void EvPaletteChanged(HWND hWndPalChg)
Forwards the WM_PALETTECHANGED message to the client window.
virtual HWND GetCommandTarget()
Locates and returns the child window that is the target of the command and command enable messages.
auto HoldFocusHWnd(HWND hWndLose, HWND hWndGain) -> bool override
Overrides TWindow's virtual function.
int GetDocTitleIndex() const
Returns the document title index.
TFrameWindow(TWindow *parent, LPCTSTR title=nullptr, TWindow *clientWnd=nullptr, bool shrinkToClient=false, TModule *module=nullptr)
Constructs a window object with the parent window supplied in parent, which is zero if this is the ma...
auto SetClientWindow(std::unique_ptr< TWindow >) -> std::unique_ptr< TWindow >
void SetKeyboardHandling(bool kh=true)
Sets flag indicating that the receiver has requested "keyboard handling" (translation of keyboard inp...
auto PreProcessMsg(MSG &) -> bool override
Overrides TWindow's virtual function.
void BroadcastResizeToChildren(uint sizeType, const TSize &size)
Tell child windows frame has minimized/maximized/restored (They may want to change enabled state or r...
auto EvCommand(uint id, HWND hWndCtl, uint notifyCode) -> TResult override
Handle WM_COMMAND to provide extra processing for commands: Extra processing for commands: starts wit...
bool EvQueryNewPalette()
Forwards the WM_QUERYNEWPALETTE message to the client window.
virtual TWindow * SetClientWindow(TWindow *clientWnd)
Sets the client window to the specified window.
void EvParentNotify(const TParentNotify &)
Responds to a message to notify the parent window that a given event has occurred.
bool SetIconSm(TModule *iconModule, TResId iconResIdSm)
Set the Small Icon (16 x 16).
void SetHWndRestoreFocus(HWND hwndRestoreFocus)
Sets the remembered focused window.
const TMenuDescr * GetMenuDescr() const
Returns a pointer to the menu descriptor for the frame window.
void SetMergeModule(TModule *module)
Remembers where the merged menu came from.
bool SetIcon(TModule *iconModule, TResId iconResId)
Sets the icon in the module specified in iconModule to the resource ID specified in iconResId.
const TBarDescr * GetBarDescr() const
Returns a pointer to the control bar descriptor.
HICON EvQueryDragIcon()
Responds to a WM_QUERYDRAGICON message sent to a minimized (iconic) window that is going to be dragge...
virtual bool AssignMenu(TResId menuResId)
Perform a high-level menu assignment either before or after the HWND for the window has been created.
bool GetKeyboardHandling() const
Returns flag indicating that the receiver has requested "keyboard handling" (translation of keyboard ...
void SetBarDescr(TBarDescr *barDescr, TAutoDelete=AutoDelete)
Sets the control bar descriptor to the new bar descriptor.
TModule * GetMergeModule()
Returns the module of the merge menu.
void EvSetFocus(HWND hWndLostFocus)
Restores the focus to the active window.
void EvInitMenuPopup(HMENU hPopupMenu, uint index, bool isSysMenu)
Responds to WM_INITMENUPOPUP by performing a command enable run on each of the menu items in the popu...
HICON GetIcon() const
Retrieve handle of icon of frame window.
void SetupWindow() override
Calls TWindow::SetUpWindow to create windows in a child list.
void RemoveChild(TWindow *) override
If someone removes our client with a RemoveChild() call, update our client and restore focus ptrs.
ObjectWindows dynamic-link libraries (DLLs) construct an instance of TModule, which acts as an object...
TPoint is a support class, derived from tagPOINT.
The tagSIZE struct is defined as.
TWindow(TWindow *parent, LPCTSTR title=nullptr, TModule *module=nullptr)
Adds this to the child list of parent if nonzero, and calls EnableAutoCreate so that this will be cre...
virtual bool SetDocTitle(LPCTSTR docname, int index)
Default behavior for updating document title is to pass it to parent frame.
HWND THandle
TWindow encapsulates an HWND.
#define DECLARE_STREAMABLE_OWL(cls, ver)
TAutoDelete
Flag for Handle ctors to control Handle deletion in dtor.
#define DECLARE_STREAMABLE_INLINES(cls)
Object Windows Library (OWLNext Core).
const unsigned int IDW_MDICLIENT
ID of MDI client window.
TDispatch< WM_PARENTNOTIFY >::TArgs TParentNotify
Alias for convenience.
LRESULT TResult
Result type.
const unsigned int IDW_FIRSTMDICHILD
child window IDs, 32 max to 32032
Base window class TWindow definition, including HWND encapsulation.