home *** CD-ROM | disk | FTP | other *** search
- // Zinc Interface Library - MAX.CPP
- // COPYRIGHT (C) 1990, 1991. All Rights Reserved.
- // Zinc Software Incorporated. Pleasant Grove, Utah USA
-
- #include "ui_win.hpp"
- #include <string.h>
-
- UIW_MAXIMIZE_BUTTON::UIW_MAXIMIZE_BUTTON(void) :
- UIW_BUTTON(0, 0, 0, 0, BTF_NO_FLAGS, WOF_JUSTIFY_CENTER | WOF_NON_FIELD_REGION,
- UIW_MAXIMIZE_BUTTON::MaximizeUserFunction)
- {
- windowID[0] = ID_MAXIMIZE_BUTTON;
- windowID[1] = ID_BUTTON;
- search.type = ID_MAXIMIZE_BUTTON;
- search.numberID = NUMID_MAXIMIZE;
- strcpy(search.stringID, "NUMID_MAXIMIZE");
-
- hotKey = HOT_KEY_MAXIMIZE;
- woAdvancedFlags |= WOAF_NON_CURRENT;
-
- // Set MS Windows flags.
- MSWindowsStyle |= WS_MAXIMIZEBOX;
- }
-
- int UIW_MAXIMIZE_BUTTON::Event(const UI_EVENT &event)
- {
- // Switch on the event type.
- int ccode = event.type;
- switch (ccode)
- {
- case S_INITIALIZE:
- if (parent)
- parent->MSWindowsStyle |= MSWindowsStyle;
- break;
-
- case S_CREATE:
- case S_SIZE:
- int height, width;
- width = GetSystemMetrics(SM_CXSIZE);
- height = GetSystemMetrics(SM_CYCAPTION) - 1;
- UI_WINDOW_OBJECT::RegionMax(TRUE);
- true.top -= 1;
- true.right += 1;
- true.bottom = true.top + height - 1;
- true.left = true.right - width + 1;
- break;
-
- default:
- ccode = UI_WINDOW_OBJECT::Event(event);
- break;
- }
-
- // Return the control code.
- return (ccode);
- }
-
- #ifdef ZIL_STORE
- #pragma argsused
- void UIW_MAXIMIZE_BUTTON::Store(const char *name, UI_STORAGE *file, USHORT storeFlags)
- {
- file->Store(search.type);
- if (!FlagSet(storeFlags, S_SUB_LEVEL))
- file->ObjectSize(name, search);
- }
- #endif
-