ScummVM API documentation
Bagel::CBofWindow Class Reference
Inheritance diagram for Bagel::CBofWindow:
Bagel::CLList Bagel::CBofObject Bagel::CBofError Bagel::CBagMasterWin Bagel::CBagStorageDevWnd Bagel::CBofBmpButton Bagel::CBofButton Bagel::CBofDialog Bagel::CBofEditText Bagel::CBofListBox Bagel::CBofScrollBar

Public Member Functions

 CBofWindow ()
 
 CBofWindow (const char *pszName, int x, int y, int nWidth, int nHeight, CBofWindow *pParent)
 
virtual ~CBofWindow ()
 
virtual ErrorCode create (const char *pszName, int x, int y, int nWidth, int nHeight, CBofWindow *pParent, uint32 nControlID=0)
 
virtual ErrorCode create (const char *pszName, CBofRect *pRect, CBofWindow *pParent, uint32 nControlID=0)
 
virtual void destroy ()
 
virtual void destroyWindow ()
 
void show ()
 
void select ()
 
void hide ()
 
void center ()
 
void move (int x, int y, bool bRepaint=false)
 
void reSize (CBofRect *pRect, bool bRepaint=false)
 
virtual ErrorCode close ()
 
void postMessage (uint32 nMessage, uint32 lParam1, uint32 lParam2)
 
void postUserMessage (uint32 lMessage, uint32 lExtraInfo)
 
void setTimer (uint32 nID, uint32 nInterval, BofCallback pCallBack=nullptr)
 
void killTimer (uint32 nID)
 
void killMyTimers ()
 
CBofWindowgetParent () const
 
void validateAnscestors (CBofRect *pRect=nullptr)
 
void setActive ()
 
CBofRect getWindowRect () const
 
CBofRect getClientRect ()
 
CBofRect getRect () const
 
int width () const
 
int height () const
 
void screenToClient (CBofPoint *pPoint)
 
void selectPalette (CBofPalette *pPal)
 
ErrorCode setBackdrop (CBofBitmap *pNewBitmap, bool bRefresh=false)
 
ErrorCode setBackdrop (const char *pszFileName, bool bRefresh=false)
 
void clearBackdrop ()
 
CBofBitmapgetBackdrop () const
 
bool hasBackdrop () const
 
void killBackdrop ()
 
ErrorCode paintBackdrop (CBofRect *pRect=nullptr, int nTransparentColor=-1)
 
void setControlID (uint32 nID)
 
uint32 getControlID () const
 
void setBkColor (RGBCOLOR cColor)
 
RGBCOLOR getBkColor () const
 
void setFgColor (RGBCOLOR cColor)
 
RGBCOLOR getFgColor () const
 
void setPrevMouseDown (CBofPoint p)
 
CBofPoint getPrevMouseDown () const
 
void setCapture ()
 
void releaseCapture ()
 
bool hasCapture () const
 
void setFocus ()
 
void releaseFocus ()
 
bool hasFocus () const
 
void flushAllMessages ()
 
void validateRect (const CBofRect *pRect)
 
void invalidateRect (const CBofRect *pRect)
 
virtual void onBofButton (CBofObject *pButton, int nExtraInfo)
 
virtual void onBofScrollBar (CBofObject *pButton, int nNewPos)
 
virtual void onBofListBox (CBofObject *pListBox, int nItemIndex)
 
virtual void onMainLoop ()
 
virtual void onSoundNotify (CBofObject *pObject, uint32 lParam2)
 
virtual void onMovieNotify (uint32 lParam1, uint32 lParam2)
 
virtual void onMCINotify (uint32 wParam, uint32 lParam)
 
virtual void onTimer (uint32 nTimerId)
 
virtual void handleEvent (const Common::Event &event)
 
Graphics::ManagedSurfacegetSurface ()
 
bool isCreated () const
 
virtual void enable ()
 
virtual void disable ()
 
bool isVisible () const
 
bool isEnabled () const
 
void updateWindow ()
 
void setParent (CBofWindow *parent)
 
void handleEvents ()
 
virtual void onKeyHit (uint32 lKey, uint32 lRepCount)
 
void fillWindow (byte iColor)
 
void fillRect (CBofRect *pRect, byte iColor)
 
ErrorCode paintBeveledText (CBofRect *rect, const CBofString &string, int size, int weight, RGBCOLOR color, int justify, uint32 format)
 
- Public Member Functions inherited from Bagel::CLList
 CLList ()
 
 CLList (void *pObj)
 
virtual ~CLList ()
 
void Insert (CLList *pNewList)
 
void Delete ()
 
void addToHead (CLList *pNewList)
 
void addToTail (CLList *pNewList)
 
void MoveToHead ()
 
void MoveToTail ()
 
void MoveLeft ()
 
void MoveRight ()
 
CLListgetHead ()
 
CLListgetTail ()
 
CLListgetPrev () const
 
CLListgetNext () const
 
void * getData () const
 
void PutData (void *pObj)
 
void FlushList ()
 
- Public Member Functions inherited from Bagel::CBofError
void reportError (ErrorCode errCode, const char *format,...)
 
bool errorOccurred () const
 
ErrorCode getErrorCode () const
 
void clearError ()
 

Static Public Member Functions

static ErrorCode initialize ()
 
static ErrorCode shutdown ()
 
static Common::Point getMousePos ()
 
static CBofWindowgetActiveWindow ()
 
static CBofWindowgetWindowList ()
 
- Static Public Member Functions inherited from Bagel::CBofObject
static bool isValidObject (const CBofObject *pObject)
 
- Static Public Member Functions inherited from Bagel::CBofError
static void fatalError (ErrorCode errCode, const char *format,...)
 
static void initialize ()
 
static int getErrorCount ()
 

Protected Member Functions

void checkTimers ()
 
virtual void onMouseMove (uint32 nFlags, CBofPoint *pPoint, void *=nullptr)
 
virtual void onLButtonDown (uint32 nFlags, CBofPoint *pPoint, void *=nullptr)
 
virtual void onLButtonUp (uint32 nFlags, CBofPoint *pPoint, void *=nullptr)
 
virtual void onLButtonDblClk (uint32 nFlags, CBofPoint *pPoint)
 
virtual void onRButtonDown (uint32 nFlags, CBofPoint *pPoint)
 
virtual void onRButtonUp (uint32 nFlags, CBofPoint *pPoint)
 
virtual void onRButtonDblClk (uint32 nFlags, CBofPoint *pPoint)
 
virtual void onReSize (CBofSize *pSize)
 
virtual void onPaint (CBofRect *pRect)
 
virtual void onClose ()
 
virtual void onUserMessage (uint32 nMessage, uint32 lParam)
 
virtual void onActivate ()
 
virtual void onDeActivate ()
 
- Protected Member Functions inherited from Bagel::CBofError
virtual void bofMessageBox (const Common::String &content, const Common::String &title)
 

Protected Attributes

CBofWindow_parent = nullptr
 
Array< CBofWindow * > _children
 
char _szTitle [64] = { 0 }
 
CBofRect _cWindowRect
 
CBofRect _cRect
 
CBofBitmap_pBackdrop = nullptr
 
uint32 _nID = 0
 
RGBCOLOR _cBkColor = RGB(255, 255, 255)
 
RGBCOLOR _cFgColor = RGB(0, 0, 0)
 
bool _bCaptured = false
 
Graphics::ManagedSurface_surface = nullptr
 
CBofPoint _cPrevMouseDown
 
- Protected Attributes inherited from Bagel::CLList
CLList_pPrev
 
CLList_pNext
 
void * _pData
 
- Protected Attributes inherited from Bagel::CBofError
ErrorCode _errCode
 

Static Protected Attributes

static CBofWindow_pWindowList
 
static CBofWindow_pActiveWindow
 
static CBofTimerPacket_pTimerList
 
static int _mouseX
 
static int _mouseY
 
- Static Protected Attributes inherited from Bagel::CBofError
static int _count
 

Constructor & Destructor Documentation

◆ CBofWindow() [1/2]

Bagel::CBofWindow::CBofWindow ( )

Default constructor

◆ CBofWindow() [2/2]

Bagel::CBofWindow::CBofWindow ( const char *  pszName,
int  x,
int  y,
int  nWidth,
int  nHeight,
CBofWindow pParent 
)

Constructor for CBofWindow

Parameters
pszNameName of window
xX position
yY position
nWidthWidth of window to create (optional)
nHeightHeight of window to create (optional)
pParentParent of this window (optional)

◆ ~CBofWindow()

virtual Bagel::CBofWindow::~CBofWindow ( )
virtual

Destructor

Member Function Documentation

◆ checkTimers()

void Bagel::CBofWindow::checkTimers ( )
protected

Checks window timers for expiry

◆ create() [1/2]

virtual ErrorCode Bagel::CBofWindow::create ( const char *  pszName,
int  x,
int  y,
int  nWidth,
int  nHeight,
CBofWindow pParent,
uint32  nControlID = 0 
)
virtual

Creates a window

Parameters
pszNameName of window
xX position of upper-left corner
yY position of upper-left corner
nWidthWidth of window to create (optional)
nHeightHeight of window to create (optional)
pParentParent of this window (optional)
nControlIDUser defined ID of this window
Returns
Error return code

Reimplemented in Bagel::CBofDialog, and Bagel::CBofEditText.

◆ create() [2/2]

virtual ErrorCode Bagel::CBofWindow::create ( const char *  pszName,
CBofRect pRect,
CBofWindow pParent,
uint32  nControlID = 0 
)
virtual

Creates a window

Parameters
pszNameName of window
pRectRectangle for window placement
pParentParent of this window (optional)
nControlIDUser defined ID of this window
Returns
Error return code

Reimplemented in Bagel::CBagStorageDevDlg, Bagel::CBofDialog, and Bagel::CBofEditText.

◆ destroy()

virtual void Bagel::CBofWindow::destroy ( )
virtual

Destroys the Window attached to this CBofWindow (if any)

◆ show()

void Bagel::CBofWindow::show ( )

Shows current window (if hidden)

◆ hide()

void Bagel::CBofWindow::hide ( )

Hides current window (if shown)

◆ center()

void Bagel::CBofWindow::center ( )

Centers current window in parent window or in screen

◆ move()

void Bagel::CBofWindow::move ( int  x,
int  y,
bool  bRepaint = false 
)

Moves current window to specified location in parent

Parameters
xNew upper left corner X position
yNew upper left corner Y position
bRepainttrue if should update the window

◆ reSize()

void Bagel::CBofWindow::reSize ( CBofRect pRect,
bool  bRepaint = false 
)

Resizes current window to specified area

Parameters
pRectNew area for window
bRepaintOptional repaint after resize

◆ postMessage()

void Bagel::CBofWindow::postMessage ( uint32  nMessage,
uint32  lParam1,
uint32  lParam2 
)

Posts a message

Parameters
nMessageMessage to post
lParam1User info
lParam2More user info

◆ postUserMessage()

void Bagel::CBofWindow::postUserMessage ( uint32  lMessage,
uint32  lExtraInfo 
)

Posts a user defined message

◆ setTimer()

void Bagel::CBofWindow::setTimer ( uint32  nID,
uint32  nInterval,
BofCallback  pCallBack = nullptr 
)

Sets a timer which calls specified callback (or onTimer)

Parameters
nIDID of timer to set
nIntervalNumber of milliseconds till event
pCallBackFunction to call when time is up

◆ killTimer()

void Bagel::CBofWindow::killTimer ( uint32  nID)

Stops specified timer

Parameters
nIDID of timer to stop

◆ killMyTimers()

void Bagel::CBofWindow::killMyTimers ( )

Stops all timers associated with current window

◆ getParent()

CBofWindow* Bagel::CBofWindow::getParent ( ) const
inline

Returns the parent window element, if any

◆ validateAnscestors()

void Bagel::CBofWindow::validateAnscestors ( CBofRect pRect = nullptr)

Causes all parent windows to have valid paint regions

Parameters
pRectArea to validate

◆ selectPalette()

void Bagel::CBofWindow::selectPalette ( CBofPalette pPal)

Selects and Realizes specified palette into current DC

Parameters
pPalPalette to select

◆ setBackdrop() [1/2]

ErrorCode Bagel::CBofWindow::setBackdrop ( CBofBitmap pNewBitmap,
bool  bRefresh = false 
)

Associates a new background bitmap to this window

Parameters
pNewBitmapNew background bitmap
bRefreshtrue if should repaint now
Returns
Error return code

◆ setBackdrop() [2/2]

ErrorCode Bagel::CBofWindow::setBackdrop ( const char *  pszFileName,
bool  bRefresh = false 
)

Associates a new background bitmap to this window

Parameters
pszFileNamenew background bitmap from file
bRefreshtrue if should repaint now
Returns
Error return code

◆ killBackdrop()

void Bagel::CBofWindow::killBackdrop ( )

Deletes the background bitmap associated with this window

◆ paintBackdrop()

ErrorCode Bagel::CBofWindow::paintBackdrop ( CBofRect pRect = nullptr,
int  nTransparentColor = -1 
)

Updates the specified section of the background bitmap

Parameters
pRectArea of bitmap to update on screen
nTransparentColorColor index used for transparency (-1 = none)
Returns
Error return code

◆ setCapture()

void Bagel::CBofWindow::setCapture ( )

Sets mouse capture for this window

◆ releaseCapture()

void Bagel::CBofWindow::releaseCapture ( )

Release mouse capture for this window

◆ hasCapture()

bool Bagel::CBofWindow::hasCapture ( ) const

Returns true if the control is capturing mouse events

◆ setFocus()

void Bagel::CBofWindow::setFocus ( )

Sets the focus on a control for keyboard input

◆ releaseFocus()

void Bagel::CBofWindow::releaseFocus ( )

Releases focus from an edit control

◆ hasFocus()

bool Bagel::CBofWindow::hasFocus ( ) const

Returns true if the control has focus

◆ validateRect()

void Bagel::CBofWindow::validateRect ( const CBofRect pRect)

Adds specified rectangle to dirty rect list for this window

Parameters
pRectRectangle to add to dirty list

◆ invalidateRect()

void Bagel::CBofWindow::invalidateRect ( const CBofRect pRect)

Removes specified rectangle from dirty rect for this window

Parameters
pRectRectangle to remove from dirty list

◆ handleEvent()

virtual void Bagel::CBofWindow::handleEvent ( const Common::Event event)
virtual

Handles a pending ScummVM event

Parameters
eventEvent to process

◆ handleEvents()

void Bagel::CBofWindow::handleEvents ( )

Handle all pending ScummVM events


The documentation for this class was generated from the following file: