home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fresh Fish 5
/
FreshFish_July-August1994.bin
/
bbs
/
os20
/
forceicon-1.2.lha
/
ForceIcon
/
Source
/
Interface.c
< prev
next >
Wrap
C/C++ Source or Header
|
1993-12-31
|
39KB
|
1,529 lines
/*
Auto: smake ForceIcon
*/
/* $Revision Header built automatically *************** (do not edit) ************
**
** © Copyright by GuntherSoft
**
** File : SnakeSYS:CPrgs/Utils/ForceIcon/Interface.c
** Created on : Friday, 22.10.93 16:28:10
** Created by : Kai Iske
** Current revision : V1.0
**
**
** Purpose
** -------
** - User-Interface for ForceIcon
**
** Revision V1.0
** --------------
** created on Friday, 22.10.93 16:28:10 by Kai Iske. LogMessage :
** --- Initial release ---
**
*********************************************************************************/
#define MainWinLeft 80
#define MainWinTop 25
#define MainWinWidth 457
#define MainWinHeight 126
#define EditWinLeft 102
#define EditWinTop 52
#define EditWinWidth 433
#define EditWinHeight 102
#define ManWinLeft 112
#define ManWinTop 60
#define ManWinWidth 438
#define ManWinHeight 41
/**********************************************************************/
/* External structures */
/**********************************************************************/
extern struct List VolumeList;
extern struct SignalSemaphore MySemaphore;
/**********************************************************************/
/* Module`s structures */
/**********************************************************************/
struct Window *MainWinHandle = NULL; // Window handles
struct Window *EditWinHandle = NULL;
struct Window *PosWinHandle = NULL;
struct Window *ManWinHandle = NULL;
static struct VisualInfo *MainVisInfo = NULL;
static struct VisualInfo *EditVisInfo = NULL;
static struct VisualInfo *ManVisInfo = NULL;
static struct Gadget *MainWinGList = NULL;
static struct Gadget *EditWinGList = NULL;
static struct Gadget *ManWinGList = NULL;
static struct Gadget *MainWinGadgets[MAINWIN_CNT];
static struct Gadget *EditWinGadgets[EDITWIN_CNT];
static struct Gadget *ManWinGadgets[MANWIN_CNT];
static struct _Object *EditWinGet = NULL;
static struct TextAttr MainWinTxtAttr,
EditWinTxtAttr,
ManWinTxtAttr;
static char MainWinFontName[40],
EditWinFontName[40],
ManWinFontName[40];
static char MainTypeStr[40];
static struct List VolList;
static struct VolEntry OrigEntry, *CloneEntry = NULL;
static WORD SelVolume, SelEdVolume, PosMode, ManualType;
static LONG SecsLeft, MinsLeft, SecsRight, MinsRight;
static WORD LastLeft, LastRight;
static struct Requester MainReq;
/**********************************************************************/
/* Window definitions */
/**********************************************************************/
static UBYTE *EditPos1Labels[] = {
(UBYTE *)"Open position window",
(UBYTE *)"Close position window",
NULL };
static UBYTE *ManType2Labels[] = {
(UBYTE *)"Device",
(UBYTE *)"Volume",
NULL };
static UWORD MainWinGTypes[] = {
LISTVIEW_KIND,
LISTVIEW_KIND,
BUTTON_KIND,
BUTTON_KIND,
BUTTON_KIND,
BUTTON_KIND,
BUTTON_KIND,
BUTTON_KIND,
BUTTON_KIND,
BUTTON_KIND,
BUTTON_KIND,
BUTTON_KIND,
TEXT_KIND,
BUTTON_KIND
};
static UWORD EditWinGTypes[] = {
CYCLE_KIND,
BUTTON_KIND,
BUTTON_KIND,
STRING_KIND,
STRING_KIND,
GENERIC_KIND,
CHECKBOX_KIND,
CYCLE_KIND,
CHECKBOX_KIND,
INTEGER_KIND,
INTEGER_KIND
};
static UWORD ManWinGTypes[] = {
STRING_KIND,
BUTTON_KIND,
BUTTON_KIND,
CYCLE_KIND
};
static struct NewGadget MainWinNGad[] = {
244, 17, 200, 56, (UBYTE *)"Ava_ilable Volumes/Devices", NULL, GD_MainVols, PLACETEXT_ABOVE|NG_HIGHLABEL, NULL, NULL,
13, 17, 200, 56, (UBYTE *)"Used _Volumes/Devices", NULL, GD_MainUseVols, PLACETEXT_ABOVE|NG_HIGHLABEL, NULL, NULL,
244, 69, 200, 12, (UBYTE *)"Add to _list", NULL, GD_MainAdd, PLACETEXT_IN, NULL, NULL,
13, 81, 100, 12, (UBYTE *)"_Edit entry...", NULL, GD_MainEdit, PLACETEXT_IN, NULL, NULL,
13, 93, 200, 12, (UBYTE *)"_Remove from list", NULL, GD_MainRemove, PLACETEXT_IN, NULL, NULL,
5, 112, 85, 12, (UBYTE *)"_Save", NULL, GD_MainSave, PLACETEXT_IN, NULL, NULL,
95, 112, 85, 12, (UBYTE *)"_Use", NULL, GD_MainUse, PLACETEXT_IN, NULL, NULL,
367, 112, 85, 12, (UBYTE *)"_Quit", NULL, GD_MainQuit, PLACETEXT_IN, NULL, NULL,
275, 112, 85, 12, (UBYTE *)"_Hide", NULL, GD_MainHide, PLACETEXT_IN, NULL, NULL,
244, 81, 200, 12, (UBYTE *)"Add _manually...", NULL, GD_MainManual, PLACETEXT_IN, NULL, NULL,
244, 93, 200, 12, (UBYTE *)"Resca_n list", NULL, GD_MainRescan, PLACETEXT_IN, NULL, NULL,
185, 112, 85, 12, (UBYTE *)"_About...", NULL, GD_MainAbout, PLACETEXT_IN, NULL, NULL,
13, 69, 200, 12, NULL, NULL, GD_MainType, 0, NULL, NULL,
113, 81, 100, 12, (UBYTE *)"_Copy...", NULL, GD_MainCopy, PLACETEXT_IN, NULL, NULL
};
static struct NewGadget EditWinNGad[] = {
108, 51, 202, 12, (UBYTE *)"_Position", NULL, GD_EditPos, PLACETEXT_LEFT, NULL, NULL,
5, 88, 85, 12, (UBYTE *)"_Ok", NULL, GD_EditOk, PLACETEXT_IN, NULL, NULL,
343, 88, 85, 12, (UBYTE *)"_Cancel", NULL, GD_EditCancel, PLACETEXT_IN, NULL, NULL,
108, 6, 297, 14, (UBYTE *)"_Volume", NULL, GD_EditVol, PLACETEXT_LEFT, NULL, NULL,
108, 69, 181, 14, (UBYTE *)"Ico_n", NULL, GD_EditIcon, PLACETEXT_LEFT, NULL, NULL,
290, 69, 20, 14, NULL, NULL, GD_EditGet, 0, NULL, NULL,
318, 69, 26, 11, (UBYTE *)"_Use Icon", NULL, GD_EditUseIcon, PLACETEXT_RIGHT, NULL, NULL,
108, 21, 297, 12, (UBYTE *)"_Type", NULL, GD_EditType, PLACETEXT_LEFT, NULL, NULL,
318, 51, 26, 11, (UBYTE *)"_IconPos", NULL, GD_EditIconPos, PLACETEXT_RIGHT, NULL, NULL,
108, 36, 67, 14, (UBYTE *)"Current _X", NULL, GD_EditX, PLACETEXT_LEFT, NULL, NULL,
338, 36, 67, 14, (UBYTE *)"Current _Y", NULL, GD_EditY, PLACETEXT_LEFT, NULL, NULL
};
static struct NewGadget ManWinNGad[] = {
82, 7, 346, 14, (UBYTE *)"_Entry", NULL, GD_ManVol, PLACETEXT_LEFT, NULL, NULL,
5, 27, 85, 12, (UBYTE *)"_Ok", NULL, GD_ManOk, PLACETEXT_IN, NULL, NULL,
349, 27, 85, 12, (UBYTE *)"_Cancel", NULL, GD_ManCancel, PLACETEXT_IN, NULL, NULL,
175, 27, 121, 12, (UBYTE *)"_Type", NULL, GD_ManType, PLACETEXT_LEFT, NULL, NULL
};
static ULONG MainWinGTags[] = {
(GTLV_ShowSelected), NULL, (GT_Underscore), '_', (TAG_DONE),
(GTLV_ShowSelected), NULL, (GT_Underscore), '_', (TAG_DONE),
(GT_Underscore), '_', (GA_Disabled), TRUE, (TAG_DONE),
(GT_Underscore), '_', (GA_Disabled), TRUE, (TAG_DONE),
(GT_Underscore), '_', (GA_Disabled), TRUE, (TAG_DONE),
(GT_Underscore), '_', (TAG_DONE),
(GT_Underscore), '_', (TAG_DONE),
(GT_Underscore), '_', (TAG_DONE),
(GT_Underscore), '_', (TAG_DONE),
(GT_Underscore), '_', (TAG_DONE),
(GT_Underscore), '_', (TAG_DONE),
(GT_Underscore), '_', (TAG_DONE),
(GTTX_Border), TRUE, (TAG_DONE),
(GT_Underscore), '_', (GA_Disabled), TRUE, (TAG_DONE)
};
static ULONG EditWinGTags[] = {
(GTCY_Labels), (ULONG)&EditPos1Labels[ 0 ], (GT_Underscore), '_', (TAG_DONE),
(GT_Underscore), '_', (TAG_DONE),
(GT_Underscore), '_', (TAG_DONE),
(STRINGA_ExitHelp), TRUE, (GTST_MaxChars), 128, (GT_Underscore), '_', (TAG_DONE),
(STRINGA_ExitHelp), TRUE, (GTST_MaxChars), 256, (GT_Underscore), '_', (TAG_DONE),
(TAG_DONE),
(GT_Underscore), '_', (GTCB_Scaled), TRUE, (TAG_DONE),
(GTCY_Labels), (ULONG)&ManType2Labels[ 0 ], (GT_Underscore), '_', (TAG_DONE),
(GT_Underscore), '_', (GTCB_Scaled), TRUE, (TAG_DONE),
(STRINGA_ExitHelp), TRUE, (GTIN_Number), 0, (GTIN_MaxChars), 4, (GT_Underscore), '_', (TAG_DONE),
(STRINGA_ExitHelp), TRUE, (GTIN_Number), 0, (GTIN_MaxChars), 4, (GT_Underscore), '_', (TAG_DONE)
};
static ULONG ManWinGTags[] = {
(STRINGA_ExitHelp), TRUE, (GTST_MaxChars), 128, (GT_Underscore), '_', (TAG_DONE),
(GT_Underscore), '_', (TAG_DONE),
(GT_Underscore), '_', (TAG_DONE),
(GTCY_Labels), (ULONG)&ManType2Labels[ 0 ], (GT_Underscore), '_', (TAG_DONE)
};
/**********************************************************************/
/* Handle the main window */
/**********************************************************************/
BOOL OpenMainWin(void)
{
// Initialize volume list
NewList(&VolList);
// Get list of available volumes
if(GetDevVolList(&VolList))
{
// Try to open main window
if(OpenWin(MainWinLeft,
MainWinTo