#include <GUIEdit.h>
Public Member Functions | |
| GUIEdit (void) | |
| ~GUIEdit (void) | |
| void | init (void) |
| initialize data | |
| void | shutdown (void) |
| shutdown all our data | |
| void | update (void) |
| process the universe | |
| Bool | readConfigFile (char *filename) |
| read the configuration file | |
| Bool | writeConfigFile (char *filename) |
| write the configuration file | |
| void | readFontFile (char *filename) |
| read file with available font definitions | |
| void | writeFontFile (char *filename) |
| write all loaded fonts to a file | |
| char * | getSaveFilename (void) |
| char * | getSavePathAndFilename (void) |
| void | setSaveFile (char *fullPathAndFilename) |
| set filename to use for saving | |
| HWND | getWindowHandle (void) |
| get window handle | |
| HINSTANCE | getInstance (void) |
| get application instance | |
| HWND | getStatusBarWindowHandle (void) |
| get status bar HWND | |
| void | createStatusBar (void) |
| create status bar | |
| void | statusMessage (StatusPart part, char *message) |
| set status bar textl | |
| void | createToolbar (void) |
| create the toolbar | |
| void | setCursor (CursorType type) |
| set cursor | |
| void | setPropertyTarget (GameWindow *window) |
| set window for property editing | |
| GameWindow * | getPropertyTarget (void) |
| get window editing properties | |
| void | loadGUIEditFontLibrary (FontLibrary *library) |
| fonts available in the editor | |
| Bool | isNameDuplicate (GameWindow *root, GameWindow *ignore, AsciiString name) |
| EditMode | getMode (void) |
| return the current mode | |
| void | setMode (EditMode mode) |
| set the new mode | |
| void | setUnsaved (Bool unsaved) |
| set unsaved flag to FALSE or TRUE | |
| Bool | newLayout (void) |
| reset editor for new layout | |
| void | setGridResolution (Int res) |
| Int | getGridResolution (void) |
| void | setGridVisible (Bool visible) |
| Bool | isGridVisible (void) |
| void | setGridSnap (Bool on) |
| Bool | isGridSnapOn (void) |
| void | setGridColor (RGBColorInt *color) |
| RGBColorInt * | getGridColor (void) |
| void | gridSnapLocation (ICoord2D *source, ICoord2D *snapped) |
| void | setShowHiddenOutlines (Bool show) |
| Bool | getShowHiddenOutlines (void) |
| void | setShowSeeThruOutlines (Bool show) |
| Bool | getShowSeeThruOutlines (void) |
| Bool | windowIsGadget (GameWindow *window) |
| is the window a gadget | |
| WindowSelectionEntry * | getSelectList (void) |
| get the selected list head | |
| GameWindow * | getFirstSelected (void) |
| get first selected window | |
| void | moveWindowTo (GameWindow *window, Int x, Int y) |
| move window | |
| Bool | isWindowSelected (GameWindow *window) |
| is window selected | |
| void | selectWindow (GameWindow *window) |
| add to selection list | |
| void | unSelectWindow (GameWindow *window) |
| remove from selection list | |
| void | clearSelections (void) |
| clear selection list | |
| Int | selectionCount (void) |
| return # of selected windows | |
| void | deleteSelected (void) |
| delete selected windows | |
| void | bringSelectedToTop (void) |
| void | selectWindowsInRegion (IRegion2D *region) |
| select the windows that are FULLY in the region specified | |
| void | dragMoveSelectedWindows (ICoord2D *dragOrigin, ICoord2D *dragDest) |
| void | computeSafeLocation (GameWindow *window, Int x, Int y, Int *safeX, Int *safeY) |
| given a position to move a window to, keep it onscreen and inside parent | |
| void | computeSafeSizeLocation (GameWindow *window, Int newX, Int newY, Int newWidth, Int newHeight, Int *safeX, Int *safeY, Int *safeWidth, Int *safeHeight) |
| given position and size to move a window to, keep it inside parent and on screen | |
| void | computeResizeLocation (EditMode resizeMode, GameWindow *window, ICoord2D *resizeOrigin, ICoord2D *resizeDest, ICoord2D *resultLoc, ICoord2D *resultSize) |
| compute new size of window using drag-resize logic | |
| void | notifyNewWindow (GameWindow *window) |
| GameWindow * | getWindowAtPos (Int x, Int y) |
| get topmost window at pos | |
| void | deleteAllWindows (void) |
| delete all windows in the editor | |
| void | removeWindowCleanup (GameWindow *window) |
| to cleanup before delete | |
| void | deleteWindow (GameWindow *window) |
| delete a game window | |
| void | clipCreationParamsToParent (GameWindow *parent, Int *x, Int *y, Int *width, Int *height) |
| GameWindow * | newWindow (UnsignedInt windowStyle, GameWindow *parent, Int x, Int y, Int width, Int height) |
| GameWindow * | newUserWindow (GameWindow *parent, Int x, Int y, Int width, Int height) |
| GameWindow * | newPushButton (GameWindow *parent, Int x, Int y, Int width, Int height) |
| GameWindow * | newCheckBox (GameWindow *parent, Int x, Int y, Int width, Int height) |
| GameWindow * | newRadioButton (GameWindow *parent, Int x, Int y, Int width, Int height) |
| GameWindow * | newTabControl (GameWindow *parent, Int x, Int y, Int width, Int height) |
| GameWindow * | newHorizontalSlider (GameWindow *parent, Int x, Int y, Int width, Int height) |
| GameWindow * | newVerticalSlider (GameWindow *parent, Int x, Int y, Int width, Int height) |
| GameWindow * | newProgressBar (GameWindow *parent, Int x, Int y, Int width, Int height) |
| GameWindow * | newListbox (GameWindow *parent, Int x, Int y, Int width, Int height) |
| GameWindow * | newTextEntry (GameWindow *parent, Int x, Int y, Int width, Int height) |
| GameWindow * | newStaticText (GameWindow *parent, Int x, Int y, Int width, Int height) |
| GameWindow * | newComboBox (GameWindow *parent, Int x, Int y, Int width, Int height) |
| Bool | menuNew (void) |
| start a new layout process | |
| Bool | menuOpen (void) |
| hit open on menu | |
| void | stripNameDecorations (GameWindow *root) |
| after a load | |
| void | revertDefaultCallbacks (GameWindow *root) |
| after a load | |
| Bool | menuSave (void) |
| hit save on menu | |
| Bool | menuSaveAs (void) |
| hit save as on menu | |
| Bool | menuExit (void) |
| exit application | |
| Bool | menuCopy (void) |
| copy selected windows into copy buffer | |
| Bool | menuPaste (void) |
| paste contents of copy buffer | |
| Bool | menuCut (void) |
| cut selected windows into copy buffer | |
| void | checkMenuItem (Int item) |
| void | unCheckMenuItem (Int item) |
| void | setLayoutInit (AsciiString init) |
| set layout init function name | |
| void | setLayoutUpdate (AsciiString update) |
| set layout update function name | |
| void | setLayoutShutdown (AsciiString shutdown) |
| set layout shutdown function name | |
| AsciiString | getLayoutInit (void) |
| get layout init function name | |
| AsciiString | getLayoutUpdate (void) |
| get layout update function name | |
| AsciiString | getLayoutShutdown (void) |
| get layout shutdown function name | |
Protected Member Functions | |
| char * | saveAsDialog (void) |
| save as standard browser | |
| char * | openDialog (void) |
| open standard browser | |
| void | validateNames (GameWindow *root, char *filename, Bool *valid) |
| void | updateRadioScreenIdentifiers (GameWindow *window, Int screenID) |
| Bool | saveData (char *filePathAndFilename, char *filename) |
| save data to file in filePath | |
| Bool | validateParentForCreate (GameWindow *parent) |
| validate parent OK | |
| void | normalizeRegion (IRegion2D *region) |
| normalize a region so that lo and hi are really lo and hi | |
| WindowSelectionEntry * | findSelectionEntry (GameWindow *window) |
| find selection entry associated with this window | |
Protected Attributes | |
| HINSTANCE | m_appInst |
| main application hInstance | |
| HWND | m_appHWnd |
| main application hWnd | |
| HWND | m_statusBarHWnd |
| status bar window handle | |
| HWND | m_toolbarHWnd |
| toolbar window handle | |
| EditMode | m_mode |
| the current editor "mode" | |
| Bool | m_unsaved |
| TRUE when contents are unsaved. | |
| char | m_savePathAndFilename [_MAX_PATH] |
| full path and filename to file | |
| char | m_saveFilename [_MAX_PATH] |
| filename only with extension | |
| WindowSelectionEntry * | m_selectList |
| list of "selected" windows | |
| GameWindow * | m_propertyTarget |
| the window to edit properties on | |
| Bool | m_gridVisible |
| TRUE when grid is visible. | |
| Int | m_gridResolution |
| pixels between the grid marks | |
| Bool | m_snapToGrid |
| TRUE when it's on. | |
| RGBColorInt | m_gridColor |
| the grid draw color | |
| Bool | m_showHiddenOutlines |
| show outlines around hidden windows | |
| Bool | m_showSeeThruOutlines |
| show outliens around see-thru windows | |
| AsciiString | m_layoutInitString |
| layout initi function name | |
| AsciiString | m_layoutUpdateString |
| layout update function name | |
| AsciiString | m_layoutShutdownString |
| layout shutdown function name | |
| GUIEdit::GUIEdit | ( | void | ) |
Definition at line 414 of file GUIEdit.cpp.
| GUIEdit::~GUIEdit | ( | void | ) |
Definition at line 448 of file GUIEdit.cpp.
| void GUIEdit::bringSelectedToTop | ( | void | ) |
bring selected windows to top
Bring the selected windows to the top so they draw on top of other windows. For window with no parents this brings them to the top of the window stack for all windows, for child windows it will bring them to the top of the child list for their parent
Definition at line 4057 of file GUIEdit.cpp.
| void GUIEdit::checkMenuItem | ( | Int | item | ) |
Check the menu item from the guiedit main menu
Definition at line 4577 of file GUIEdit.cpp.
| void GUIEdit::clearSelections | ( | void | ) |
| void GUIEdit::clipCreationParamsToParent | ( | GameWindow * | parent, |
| Int * | x, | ||
| Int * | y, | ||
| Int * | width, | ||
| Int * | height ) |
when creating child windows we don't want them to exist outside the parent so we use this to clip them to the the parent size and locations
Definition at line 1316 of file GUIEdit.cpp.
| void GUIEdit::computeResizeLocation | ( | EditMode | resizeMode, |
| GameWindow * | window, | ||
| ICoord2D * | resizeOrigin, | ||
| ICoord2D * | resizeDest, | ||
| ICoord2D * | resultLoc, | ||
| ICoord2D * | resultSize ) |
compute new size of window using drag-resize logic
Given the current resize drag mode, the selected window to resize, the start location of the drag, and the end location of the drag, figure out what the upper left corner location and the size of the window should be
Definition at line 4339 of file GUIEdit.cpp.
| void GUIEdit::computeSafeLocation | ( | GameWindow * | window, |
| Int | x, | ||
| Int | y, | ||
| Int * | safeX, | ||
| Int * | safeY ) |
given a position to move a window to, keep it onscreen and inside parent
If we attempt to move the window to the given (x,y) it may result in that location being either outside of the screen or outside of the parent. This method will compute a location as close to the desired (x,y) as possible but still remain within the parent and on the screen
Definition at line 4182 of file GUIEdit.cpp.
| void GUIEdit::computeSafeSizeLocation | ( | GameWindow * | window, |
| Int | newX, | ||
| Int | newY, | ||
| Int | newWidth, | ||
| Int | newHeight, | ||
| Int * | safeX, | ||
| Int * | safeY, | ||
| Int * | safeWidth, | ||
| Int * | safeHeight ) |
given position and size to move a window to, keep it inside parent and on screen
Like the method computeSafeLocation, this method also takes into account the new position AND size, keeping them within the screen and within any parents
NOTE: this assumes it is for the resizing code which assumes that the resize will not invert across the anchor point so we're only checking origin points and sizes compared to parents and the screen;
Location returned is relative to parent window if present
Definition at line 4266 of file GUIEdit.cpp.
| void GUIEdit::createStatusBar | ( | void | ) |
create status bar
Create a status bar at the bottom of the editor
Definition at line 3347 of file GUIEdit.cpp.
| void GUIEdit::createToolbar | ( | void | ) |
| void GUIEdit::deleteAllWindows | ( | void | ) |
delete all windows in the editor
Delete all windows in the editor
Definition at line 1376 of file GUIEdit.cpp.
| void GUIEdit::deleteSelected | ( | void | ) |
delete selected windows
Delete the windows in the selection list
Definition at line 4015 of file GUIEdit.cpp.
| void GUIEdit::deleteWindow | ( | GameWindow * | window | ) |
move windows via drag move
Move all the windows in the selection list from a drag move, note that we are keeping the positions within the screen and parent windows
Definition at line 4109 of file GUIEdit.cpp.
|
protected |
find selection entry associated with this window
Find selection entry for this window
Definition at line 297 of file GUIEdit.cpp.
| GameWindow * GUIEdit::getFirstSelected | ( | void | ) |
get first selected window
Get the first GameWindow * from the selection list
Definition at line 4165 of file GUIEdit.cpp.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
| WindowSelectionEntry * GUIEdit::getSelectList | ( | void | ) |
|
inline |
| GameWindow * GUIEdit::getWindowAtPos | ( | Int | x, |
| Int | y ) |
get topmost window at pos
Given a mouse position, get the topmost window at that location
Definition at line 1222 of file GUIEdit.cpp.
|
inline |
Given the source input point, return in 'snapped' the closest grid point
Definition at line 4562 of file GUIEdit.cpp.
| void GUIEdit::init | ( | void | ) |
| Bool GUIEdit::isNameDuplicate | ( | GameWindow * | root, |
| GameWindow * | ignore, | ||
| AsciiString | name ) |
Is the name passed in found as the name of any window in in the tree starting at root ... but we will ignore the window 'ignore' if present
Definition at line 4611 of file GUIEdit.cpp.
| Bool GUIEdit::isWindowSelected | ( | GameWindow * | window | ) |
| void GUIEdit::loadGUIEditFontLibrary | ( | FontLibrary * | library | ) |
fonts available in the editor
Load the set of fonts that we will make available to users in in the editor
Definition at line 4641 of file GUIEdit.cpp.
| Bool GUIEdit::menuCopy | ( | void | ) |
copy selected windows into copy buffer
Copy selected windows into clipboard
Definition at line 3785 of file GUIEdit.cpp.
| Bool GUIEdit::menuCut | ( | void | ) |
cut selected windows into copy buffer
Cut selected windows into the clipboard
Definition at line 3824 of file GUIEdit.cpp.
| Bool GUIEdit::menuExit | ( | void | ) |
exit application
The user clicked on exit in the menu and wishes to exit the editor
Definition at line 3439 of file GUIEdit.cpp.
| Bool GUIEdit::menuNew | ( | void | ) |
| Bool GUIEdit::menuOpen | ( | void | ) |
hit open on menu
User has clicked on file->open
Definition at line 3616 of file GUIEdit.cpp.
| Bool GUIEdit::menuPaste | ( | void | ) |
paste contents of copy buffer
Paste contents of clipboard into current layout
Definition at line 3813 of file GUIEdit.cpp.
| Bool GUIEdit::menuSave | ( | void | ) |
| Bool GUIEdit::menuSaveAs | ( | void | ) |
| void GUIEdit::moveWindowTo | ( | GameWindow * | window, |
| Int | x, | ||
| Int | y ) |
move window
Move the window passed into the the absolute position (x,y), note that there is NO SAFE checking done on that position
Definition at line 4533 of file GUIEdit.cpp.
| GameWindow * GUIEdit::newCheckBox | ( | GameWindow * | parent, |
| Int | x, | ||
| Int | y, | ||
| Int | width, | ||
| Int | height ) |
Create a new check box
Definition at line 1687 of file GUIEdit.cpp.
| GameWindow * GUIEdit::newComboBox | ( | GameWindow * | parent, |
| Int | x, | ||
| Int | y, | ||
| Int | width, | ||
| Int | height ) |
Create a new list box
@TODO: We still need to set the IME Composite Text colors in TheDefaultScheme
Definition at line 2475 of file GUIEdit.cpp.
| GameWindow * GUIEdit::newHorizontalSlider | ( | GameWindow * | parent, |
| Int | x, | ||
| Int | y, | ||
| Int | width, | ||
| Int | height ) |
Create a new horizontal slider
Definition at line 2098 of file GUIEdit.cpp.
| Bool GUIEdit::newLayout | ( | void | ) |
reset editor for new layout
Reset the editor for a new layout
Definition at line 3418 of file GUIEdit.cpp.
| GameWindow * GUIEdit::newListbox | ( | GameWindow * | parent, |
| Int | x, | ||
| Int | y, | ||
| Int | width, | ||
| Int | height ) |
Create a new list box
Definition at line 2890 of file GUIEdit.cpp.
| GameWindow * GUIEdit::newProgressBar | ( | GameWindow * | parent, |
| Int | x, | ||
| Int | y, | ||
| Int | width, | ||
| Int | height ) |
Create a new progress bar
Definition at line 2340 of file GUIEdit.cpp.
| GameWindow * GUIEdit::newPushButton | ( | GameWindow * | parent, |
| Int | x, | ||
| Int | y, | ||
| Int | width, | ||
| Int | height ) |
Create a new push button
Definition at line 1595 of file GUIEdit.cpp.
| GameWindow * GUIEdit::newRadioButton | ( | GameWindow * | parent, |
| Int | x, | ||
| Int | y, | ||
| Int | width, | ||
| Int | height ) |
Create a new radio button
Definition at line 1792 of file GUIEdit.cpp.
| GameWindow * GUIEdit::newStaticText | ( | GameWindow * | parent, |
| Int | x, | ||
| Int | y, | ||
| Int | width, | ||
| Int | height ) |
Create a new static text
Definition at line 3259 of file GUIEdit.cpp.
| GameWindow * GUIEdit::newTabControl | ( | GameWindow * | parent, |
| Int | x, | ||
| Int | y, | ||
| Int | width, | ||
| Int | height ) |
Create a tab control gadget
Definition at line 1900 of file GUIEdit.cpp.
| GameWindow * GUIEdit::newTextEntry | ( | GameWindow * | parent, |
| Int | x, | ||
| Int | y, | ||
| Int | width, | ||
| Int | height ) |
Create a new text entry
Definition at line 3153 of file GUIEdit.cpp.
| GameWindow * GUIEdit::newUserWindow | ( | GameWindow * | parent, |
| Int | x, | ||
| Int | y, | ||
| Int | width, | ||
| Int | height ) |
Create a new window at the given location
Definition at line 1537 of file GUIEdit.cpp.
| GameWindow * GUIEdit::newVerticalSlider | ( | GameWindow * | parent, |
| Int | x, | ||
| Int | y, | ||
| Int | width, | ||
| Int | height ) |
Create a new vertical slider
Definition at line 2219 of file GUIEdit.cpp.
| GameWindow * GUIEdit::newWindow | ( | UnsignedInt | windowStyle, |
| GameWindow * | parent, | ||
| Int | x, | ||
| Int | y, | ||
| Int | width, | ||
| Int | height ) |
Create a new window of the specified type. This is the single creation point for all windows created in the editor
Definition at line 1451 of file GUIEdit.cpp.
|
protected |
normalize a region so that lo and hi are really lo and hi
Normalize the region so that lo and hi are actually lo and hi
Definition at line 325 of file GUIEdit.cpp.
| void GUIEdit::notifyNewWindow | ( | GameWindow * | window | ) |
this is called after a window is added to the editor, the window may contain children so this might be recursively called from inside
The passed in window has just been added into the GUI layout. It It may also contain children which we will recursively call upon so that every window gets a chance to run through this method
Definition at line 3981 of file GUIEdit.cpp.
|
protected |
open standard browser
Bring up the standard windows browser open dialog and return filename selected
Definition at line 164 of file GUIEdit.cpp.
| Bool GUIEdit::readConfigFile | ( | char * | filename | ) |
read the configuration file
Read the guiedit config file
Definition at line 806 of file GUIEdit.cpp.
| void GUIEdit::readFontFile | ( | char * | filename | ) |
read file with available font definitions
Read the font file defintitions and load them
Definition at line 871 of file GUIEdit.cpp.
| void GUIEdit::removeWindowCleanup | ( | GameWindow * | window | ) |
to cleanup before delete
This is called on each window before it is deleted or removed from the active windows in the editor to allow the system to cleanup before the delete
Definition at line 1397 of file GUIEdit.cpp.
| void GUIEdit::revertDefaultCallbacks | ( | GameWindow * | root | ) |
after a load
After a load, we will restore default callbacks to all user windows loaded from the file
Definition at line 3587 of file GUIEdit.cpp.
|
protected |
save as standard browser
Bring up the standard windows browser save as dialog and return filename selected
Definition at line 122 of file GUIEdit.cpp.
|
protected |
| Int GUIEdit::selectionCount | ( | void | ) |
return # of selected windows
How many items are selected
Definition at line 3958 of file GUIEdit.cpp.
| void GUIEdit::selectWindow | ( | GameWindow * | window | ) |
| void GUIEdit::selectWindowsInRegion | ( | IRegion2D * | region | ) |
select the windows that are FULLY in the region specified
Select all the windows that are fully in the region
Definition at line 364 of file GUIEdit.cpp.
| void GUIEdit::setCursor | ( | CursorType | type | ) |
|
inline |
|
inline |
|
inline |
|
inline |
| void GUIEdit::setMode | ( | EditMode | mode | ) |
|
inline |
| void GUIEdit::setSaveFile | ( | char * | fullPathAndFilename | ) |
set filename to use for saving
Set our member variables for the full path and filename passed in to this method. We will also extract the filename only from the full path and save that separately
Definition at line 251 of file GUIEdit.cpp.
| void GUIEdit::setShowHiddenOutlines | ( | Bool | show | ) |
Definition at line 4662 of file GUIEdit.cpp.
| void GUIEdit::setShowSeeThruOutlines | ( | Bool | show | ) |
Definition at line 4676 of file GUIEdit.cpp.
| void GUIEdit::setUnsaved | ( | Bool | unsaved | ) |
set unsaved flag to FALSE or TRUE
Set the current contents of the editor as either saved or unsaved, when we're entering an unsaved state we will put a marker in the title bar of the app, when leaving an unsaved state we will remove that marker
Definition at line 208 of file GUIEdit.cpp.
| void GUIEdit::shutdown | ( | void | ) |
| void GUIEdit::statusMessage | ( | StatusPart | part, |
| char * | message ) |
| void GUIEdit::stripNameDecorations | ( | GameWindow * | root | ) |
after a load
Strip name decorations of the entire tree of windows
Definition at line 3540 of file GUIEdit.cpp.
| void GUIEdit::unCheckMenuItem | ( | Int | item | ) |
Un-check the menu item from the guiedit main menu
Definition at line 4593 of file GUIEdit.cpp.
| void GUIEdit::unSelectWindow | ( | GameWindow * | window | ) |
remove from selection list
Remove window from the selection list
Definition at line 3916 of file GUIEdit.cpp.
| void GUIEdit::update | ( | void | ) |
process the universe
Update method for our GUI edit application
Definition at line 723 of file GUIEdit.cpp.
|
protected |
|
protected |
Stored in the m_decorated field for each window is a name given by the user. When we write this name into the window file it will be prefixed by the filename and a : such as (MainMenu.wnd:OKButton). When we re-load these window definitions the whole decorated name will be read and loaded into the decorated name field, therefore we must make sure the entire name once decorated will fit into the field
|
protected |
validate parent OK
This method is used when creating new windows and gadgets, if a parent is present, that parent cannot be a GUI gadget because those gadgets are atomic units, they can not contain user defined children
Definition at line 272 of file GUIEdit.cpp.
| Bool GUIEdit::windowIsGadget | ( | GameWindow * | window | ) |
is the window a gadget
Return TRUE if this window is one of our predefined gadtet types
Definition at line 4547 of file GUIEdit.cpp.
| Bool GUIEdit::writeConfigFile | ( | char * | filename | ) |
write the configuration file
Write the guiedit config file
Definition at line 751 of file GUIEdit.cpp.
| void GUIEdit::writeFontFile | ( | char * | filename | ) |
write all loaded fonts to a file
If we can, write a file containing a definition of all the fonts we have loaded
Definition at line 939 of file GUIEdit.cpp.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |