Skip to content

Commit

Permalink
Implemented CWindow::Update() method
Browse files Browse the repository at this point in the history
This method will allow the clearing of the background of the window,
when the client has no draw() method defined, or when that method does
not do anything.
  • Loading branch information
Colin Ward committed Jan 28, 2025
1 parent 3608c6c commit 109b65d
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
29 changes: 29 additions & 0 deletions StdWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3189,6 +3189,35 @@ TBool CWindow::ShiftPressed()
return(m_bShiftPressed);
}

/**
* Triggers an update of the window.
* This method is for use when clearing the background of the window is desired. Usually, it is not required to
* manually call this method, as The Framework will take care of such things as redrawing the window when needed.
* However, in certain circumstances, such as when the client has no draw() method, or when that method does not
* do anything, it may be necessary to call this method to clear the background of the window.
*
* @pre The window has been created with open()
*
* @date Wednesday 29-Jan-2025 5:59 am, Code HQ Tokyo Tsukuda
*/

void CWindow::Update()
{

#ifdef __amigaos__

#elif defined(QT_GUI_LIB)

GetRootWindow()->m_poWindow->update();

#else /* ! QT_GUI_LIB */

ASSERTM(RedrawWindow(m_poWindow, NULL, NULL, RDW_ERASE | RDW_INVALIDATE), "CWindow::Update() => Unable to update window");

#endif /* ! QT_GUI_LIB */

}

/**
* Modifies a menu item in a dropdown menu.
* This function updates an already existing menu item in a dropdown menu. The dropdown menu
Expand Down
2 changes: 2 additions & 0 deletions StdWindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,8 @@ class CWindow

void ShowCursor(bool a_bShow);

void Update();

void UpdateMenuItem(const char *a_pccLabel, const char *a_pccHotKey, TInt a_iOrdinal, TInt a_iCommand);

/* Accessor functions */
Expand Down

0 comments on commit 109b65d

Please sign in to comment.