home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 1997 January
/
Chip_1997-01_cd.bin
/
ms95
/
disk21
/
dir04
/
f015110.re_
/
f015110.re
Wrap
Text File
|
1996-04-02
|
18KB
|
509 lines
/*----------------------------------------------------------------------+
| |
| Copyright (1995) Bentley Systems, Inc., All rights reserved. |
| |
| "MicroStation" is a registered trademark and "MDL" and "MicroCSL" |
| are trademarks of Bentley Systems, Inc. |
| |
| Limited permission is hereby granted to reproduce and modify this |
| copyrighted material provided that the resulting code is used only |
| in conjunction with Bentley Systems products under the terms of the |
| license agreement provided therein, and that this notice is retained |
| in its entirety in any such reproduction or modification. |
| |
+----------------------------------------------------------------------*/
/*----------------------------------------------------------------------+
| |
| $Logfile: J:/mdl/examples/iconedit/iconedit.r_v $
| $Workfile: iconedit.r $
| $Revision: 6.0 $
| $Date: 29 Jun 1995 10:04:44 $
| |
+----------------------------------------------------------------------*/
/*----------------------------------------------------------------------+
| |
| Function - |
| |
| Icon Editor Dialog Resources |
| |
+----------------------------------------------------------------------*/
/*----------------------------------------------------------------------+
| |
| Include Files |
| |
+----------------------------------------------------------------------*/
#include <rscdefs.h>
#include <cmdclass.h>
#include <dlogbox.h>
#include <dlogids.h>
#include <keys.h>
#include "iconedit.h"
#include "icontext.h"
#include "iconcmd.h"
/*----------------------------------------------------------------------+
| |
| Raster Icon Editor Dialog Box |
| |
+----------------------------------------------------------------------*/
#undef XC
#define XC (DCOORD_RESOLUTION/2) * ASPECT_ICON
DialogBoxRsc DIALOGID_Icon =
{
DIALOGATTR_DEFAULT | DIALOGATTR_SINKABLE,
45*XC, 45*YC+2,
NOHELP, MHELP, HOOKDIALOGID_Icon, NOPARENTID,
TXT_RasterIconEditor,
{
{{10*XC+3, 1*YC+9, 40*XC, 0}, Label, LABELID_IconSize, ON, 0, TXT_IconSize, ""},
{{3*XC+2, 3*YC+3, 4*XC+1, 2*YC+1}, Generic, GENERICID_IconSmall, ON, 0,"", ""},
{{14*XC+3, 2*YC+1, 19*XC+2, 9*YC+8}, Generic, GENERICID_IconLarge, ON, 0,"", ""},
{{14*XC+3, 14*YC+1, 15*XC, 0}, Label, LABELID_Position, ON,
ALIGN_LEFT, TXT_Position, ""},
{{1*XC+4, 8*YC+4, 11*XC, 0}, OptionButton, OPTIONBUTTONID_Tool, ON, 0, "", ""},
{{1*XC+4, 10*YC, 11*XC, 0}, OptionButton, OPTIONBUTTONID_Mode, ON,0,"",""},
{{1*XC+4, 11*YC+8, 11*XC, 0}, OptionButton, OPTIONBUTTONID_Size, ON,0,"",""},
{{0, 0, 0, 0}, MenuBar, MENUBARID_Icon, ON, 0, "", ""},
{{14*XC+3, 15*YC+3, 10*XC, 0}, Text, TEXTID_IconName, ON, 0, "", ""},
{{14*XC+3, 25*YC+3, 5*XC, 0}, Text, TEXTID_RscId, ON, 0, "", ""},
{{17*XC+2, 12*YC, 2*XC+5, 1*YC+5}, Generic, GENERICID_ShiftLeft, ON, 0, "", ""},
{{20*XC+5, 12*YC, 2*XC+5, 1*YC+5}, Generic, GENERICID_ShiftUp, ON, 0, "", ""},
{{24*XC+2, 12*YC, 2*XC+5, 1*YC+5}, Generic, GENERICID_ShiftDown, ON, 0, "", ""},
{{27*XC+5, 12*YC, 2*XC+5, 1*YC+5}, Generic, GENERICID_ShiftRight, ON, 0, "", ""},
}
};
/*----------------------------------------------------------------------+
| |
| Open Icon Resource Dialog Box |
| |
+----------------------------------------------------------------------*/
#undef XC
#define XC (DCOORD_RESOLUTION/2) * ASPECT_OPENRESOURCE
#define X1 2*XC
#define X2 5*XC
#define X3 25*XC
#define Y1 2*YC
#define Y2 15*YC
DialogBoxRsc DIALOGID_OpenIconResource =
{
DIALOGATTR_MODAL,
50*XC, 18*YC,
NOHELP, MHELP, HOOKDIALOGID_OpenIconResource, NOPARENTID,
TXT_OpenIconResource,
{
{{XC, 2*YC, 0, 0}, ListBox, LISTBOXID_RscNum, ON, 0, "", ""},
{{5*XC, 15*YC,BUTTON_STDWIDTH,0}, PushButton, PUSHBUTTONID_OK, ON, 0, "", ""},
{{37*XC,15*YC,BUTTON_STDWIDTH,0}, PushButton, PUSHBUTTONID_Cancel, ON,0,"", ""},
}
};
#undef X1
#undef X2
#undef X3
#undef Y1
#undef Y2
#undef Y3
#undef Y4
/*----------------------------------------------------------------------+
| |
| User Size Dialog Box |
| |
+----------------------------------------------------------------------*/
#undef XC
#define XC (DCOORD_RESOLUTION/2) * ASPECT_USERSIZE
#define X1 12*XC
#define Y1 YC / 2
#define Y2 2*YC
#define Y3 4*YC
DialogBoxRsc DIALOGID_UserSize =
{
DIALOGATTR_MODAL,
24*XC, 13*YC/2,
NOHELP, MHELP, NOHOOK, NOPARENTID,
TXT_UserSize,
{
/*00*/ {{X1, Y1, 4*XC, 0}, Text, TEXTID_Width,
ON, 0, "", ""},
/*01*/ {{X1, Y2, 4*XC, 0}, Text, TEXTID_Height,
ON, 0, "", ""},
/*02*/ {{3*XC,Y3,BUTTON_STDWIDTH,0}, PushButton, PUSHBUTTONID_OK,
ON, 0, "", ""},
/*03*/ {{14*XC,Y3,BUTTON_STDWIDTH,0}, PushButton, PUSHBUTTONID_Cancel,
ON,0,"", ""},
}
};
#undef X1
#undef Y1
#undef Y2
#undef Y3
/*----------------------------------------------------------------------+
| |
| Item Instances |
| |
+----------------------------------------------------------------------*/
/*----------------------------------------------------------------------+
| |
| Generic Icon Resource |
| |
+----------------------------------------------------------------------*/
DItem_GenericRsc GENERICID_IconLarge =
{
NOHELP, MHELP, HOOKITEMID_Generic_IconLarge, NOARG
};
DItem_GenericRsc GENERICID_IconSmall =
{
NOHELP, MHELP, HOOKITEMID_Generic_IconSmall, NOARG
};
DItem_GenericRsc GENERICID_ShiftUp =
{
NOHELP, MHELP, HOOKITEMID_Generic_Shift, 0
};
DItem_GenericRsc GENERICID_ShiftDown =
{
NOHELP, MHELP, HOOKITEMID_Generic_Shift, 2
};
DItem_GenericRsc GENERICID_ShiftLeft =
{
NOHELP, MHELP, HOOKITEMID_Generic_Shift, 1
};
DItem_GenericRsc GENERICID_ShiftRight =
{
NOHELP, MHELP, HOOKITEMID_Generic_Shift, 3
};
/*----------------------------------------------------------------------+
| |
| Icon MenuBar |
| |
+----------------------------------------------------------------------*/
DItem_MenuBarRsc MENUBARID_Icon =
{
NOHOOK, NOARG,
{
{PulldownMenu, PULLDOWNMENUID_IconFile},
{PulldownMenu, PULLDOWNMENUID_IconEdit},
{PulldownMenu, PULLDOWNMENUID_Import},
}
};
/*----------------------------------------------------------------------+
| |
| Icon Menus |
| |
+----------------------------------------------------------------------*/
DItem_PulldownMenuRsc PULLDOWNMENUID_IconFile =
{
NOHELP, OHELPTASKIDCMD, NOHOOK, ON | ALIGN_LEFT, TXT_File,
{
{TXT_NewFile, 'N'|VBIT_CTRL,ON,NOMARK,0,NOSUBMENU,
NOHELP,OHELPTASKIDCMD,NOHOOK, MENUSEARCHID_NewFile,
CMD_ICONEDIT_NEWFILE, OTASKID, ""},
{TXT_OpenFile, 'O'|VBIT_CTRL,ON,NOMARK,0,NOSUBMENU,
NOHELP,OHELPTASKIDCMD,NOHOOK, MENUSEARCHID_OpenFile,
CMD_ICONEDIT_OPENFILE, OTASKID, ""},
{TXT_NewIcon, NOACCEL,ON,NOMARK, 0, NOSUBMENU,
NOHELP, OHELPTASKIDCMD, NOHOOK, MENUSEARCHID_NewIcon,
CMD_ICONEDIT_NEWICON, OTASKID, ""},
{TXT_OpenIcon, 'I'|VBIT_CTRL,OFF,NOMARK, 0, NOSUBMENU,
NOHELP, OHELPTASKIDCMD, NOHOOK, MENUSEARCHID_OpenIcon,
CMD_ICONEDIT_OPENICON, OTASKID, ""},
{"-", NOACCEL,OFF, NOMARK, 0, NOSUBMENU,
NOHELP, OHELPTASKIDCMD, NOHOOK, 0,
NOCMD, OTASKID, ""},
{TXT_Save, 'S'|VBIT_CTRL,ON,NOMARK, 0, NOSUBMENU,
NOHELP, OHELPTASKIDCMD, NOHOOK, MENUSEARCHID_Save,
CMD_ICONEDIT_SAVE, OTASKID, ""},
{TXT_SaveTo, NOACCEL,ON,NOMARK, 0, NOSUBMENU,
NOHELP, OHELPTASKIDCMD, NOHOOK, MENUSEARCHID_SaveTo,
CMD_ICONEDIT_SAVETO, OTASKID, ""},
{"-", NOACCEL,OFF,NOMARK, 0, NOSUBMENU,
NOHELP, OHELPTASKIDCMD, NOHOOK, 0,
NOCMD, OTASKID, ""},
{TXT_Quit, NOACCEL, ON,NOMARK, 0, NOSUBMENU,
NOHELP, OHELPTASKIDCMD, NOHOOK, MENUSEARCHID_Quit,
CMD_ICONEDIT_QUIT, OTASKID, "1"}
}
};
DItem_PulldownMenuRsc PULLDOWNMENUID_IconEdit =
{
NOHELP, OHELPTASKIDCMD, NOHOOK, ON | ALIGN_LEFT, TXT_Edit,
{
{TXT_Fill, NOACCEL,ON,MARK_TOGGLE_OUT, 0, NOSUBMENU,
NOHELP, OHELPTASKIDCMD, NOHOOK, MENUSEARCHID_Fill,
CMD_ICONEDIT_FILL, OTASKID, ""},
{"-", NOACCEL,OFF, NOMARK, 0, NOSUBMENU,
NOHELP, OHELPTASKIDCMD, NOHOOK, 0,
NOCMD, OTASKID, ""},
{TXT_Clear, NOACCEL,ON,NOMARK, 0, NOSUBMENU,
NOHELP, OHELPTASKIDCMD, NOHOOK, MENUSEARCHID_Clear,
CMD_ICONEDIT_CLEAR, OTASKID, ""},
{"-", NOACCEL,OFF, NOMARK, 0, NOSUBMENU,
NOHELP, OHELPTASKIDCMD, NOHOOK, 0,
NOCMD, OTASKID, ""},
{TXT_ShiftLeft, NOACCEL,ON, NOMARK, 0, NOSUBMENU,
NOHELP, OHELPTASKIDCMD, NOHOOK, MENUSEARCHID_ShiftLeft,
CMD_ICONEDIT_SHIFT_LEFT, OTASKID, ""},
{TXT_ShiftRight, NOACCEL,ON, NOMARK, 0, NOSUBMENU,
NOHELP, OHELPTASKIDCMD, NOHOOK, MENUSEARCHID_ShiftRight,
CMD_ICONEDIT_SHIFT_RIGHT, OTASKID, ""},
{TXT_ShiftUp, NOACCEL,ON,NOMARK, 0, NOSUBMENU,
NOHELP, OHELPTASKIDCMD, NOHOOK, MENUSEARCHID_ShiftUp,
CMD_ICONEDIT_SHIFT_UP, OTASKID, ""},
{TXT_ShiftDown, NOACCEL,ON,NOMARK, 0, NOSUBMENU,
NOHELP, OHELPTASKIDCMD, NOHOOK, MENUSEARCHID_ShiftDown,
CMD_ICONEDIT_SHIFT_DOWN, OTASKID, "1"},
}
};
/*----------------------------------------------------------------------+
| |
| Import Menus |
| |
+----------------------------------------------------------------------*/
DItem_PulldownMenuRsc PULLDOWNMENUID_Import =
{
NOHELP, OHELPTASKIDCMD, NOHOOK, ON | ALIGN_LEFT, TXT_Import,
{
{TXT_Graphics, NOACCEL,ON,NOMARK,0,NOSUBMENU,
NOHELP,OHELPTASKIDCMD,NOHOOK, MENUSEARCHID_ImportGraphics,
CMD_ICONEDIT_IMPORT_GRAPHICS, OTASKID, ""},
{TXT_Cell, NOACCEL,ON,NOMARK,0,NOSUBMENU,
NOHELP,OHELPTASKIDCMD,NOHOOK, MENUSEARCHID_ImportCell,
CMD_ICONEDIT_IMPORT_CELL, OTASKID, ""},
}
};
/*----------------------------------------------------------------------+
| |
| Icon Option Button Items |
| |
+----------------------------------------------------------------------*/
DItem_OptionButtonRsc OPTIONBUTTONID_Tool =
{
NOSYNONYM, NOHELP, MHELP, NOHOOK, NOARG,
"",
"iconEditP->tool",
{
{NOTYPE, NOICON, CMD_ICONEDIT_TOOL_LINE, LCMD, 0, NOMASK, ON, TXT_Line},
{NOTYPE, NOICON, CMD_ICONEDIT_TOOL_BRUSH, LCMD, 1, NOMASK, ON, TXT_Brush},
{NOTYPE, NOICON, CMD_ICONEDIT_TOOL_RECTANGLE, LCMD, 2, NOMASK, ON, TXT_Rectangle},
{NOTYPE, NOICON, CMD_ICONEDIT_TOOL_CIRCLE, LCMD, 3, NOMASK, ON, TXT_Circle}
}
};
DItem_OptionButtonRsc OPTIONBUTTONID_Mode =
{
NOSYNONYM, NOHELP, MHELP, NOHOOK, NOARG,
"",
"iconEditP->mode",
{
{NOTYPE, NOICON, NOCMD, LCMD, 0, NOMASK, ON, TXT_Toggle},
{NOTYPE, NOICON, NOCMD, LCMD, 1, NOMASK, ON, TXT_Set},
{NOTYPE, NOICON, NOCMD, LCMD, 2, NOMASK, ON, TXT_Clear}
}
};
DItem_OptionButtonRsc OPTIONBUTTONID_Size =
{
NOSYNONYM, NOHELP, MHELP, HOOKITEMID_Option_Size, NOARG,
"",
"iconEditP->sizeIndex",
{
{NOTYPE, NOICON, NOCMD, LCMD, 0, NOMASK, ON, TXT_23x23},
{NOTYPE, NOICON, NOCMD, LCMD, 1, NOMASK, ON, TXT_31x31},
{NOTYPE, NOICON, NOCMD, LCMD, 2, NOMASK, ON, TXT_User}
}
};
/*----------------------------------------------------------------------+
| |
| Text Item Resources |
| |
+----------------------------------------------------------------------*/
DItem_TextRsc TEXTID_IconName =
{
NOCMD, LCMD, NOSYNONYM, NOHELP, MHELP, HOOKITEMID_TextItem, NOARG,
15, "%s", "%s", "", "", NOMASK, CONCAT,
TXT_IconName,
"iconEditP->iconName"
};
DItem_TextRsc TEXTID_RscId =
{
NOCMD, LCMD, NOSYNONYM, NOHELP, MHELP, HOOKITEMID_TextItem, NOARG,
15, "%ld", "%ld", "", "", NOMASK, CONCAT,
TXT_RscId,
"iconEditP->inRscId"
};
DItem_TextRsc TEXTID_Width =
{
NOCMD, LCMD, NOSYNONYM, NOHELP, MHELP, NOHOOK, NOARG,
4, "%d", "%d", "5", "100", NOMASK, NOCONCAT,
TXT_Width,
"iconEditP->width"
};
DItem_TextRsc TEXTID_Height =
{
NOCMD, LCMD, NOSYNONYM, NOHELP, MHELP, NOHOOK, NOARG,
4, "%d", "%d", "5", "100", NOMASK, NOCONCAT,
TXT_Height,
"iconEditP->height"
};
/*----------------------------------------------------------------------+
| |
| List Box Item Resources |
| |
+----------------------------------------------------------------------*/
DItem_ListBoxRsc LISTBOXID_RscNum =
{
NOHELP, MHELP, HOOKITEMID_List_RscNum, NOARG, 0, 10, 0, "",
{
{10*XC, 10, ALIGN_CENTER, TXT_Resource },
{ 7*XC, 4, ALIGN_CENTER, TXT_Type },
{10*XC, 7, ALIGN_CENTER, TXT_Size },
{17*XC, 16, ALIGN_LEFT, TXT_IconName1 },
}
};
/*----------------------------------------------------------------------+
| |
| Icon Item Resource |
| |
+----------------------------------------------------------------------*/
IconRsc ICONID_ShiftRight =
{
15, 15, FORMAT_MONOBITMAP, BLACK_INDEX, "ShiftRight",
{
0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0xc0, 0x00,
0xe0, 0x00, 0xf0, 0x00, 0xf8, 0x00, 0xfc, 0x03,
0xe0, 0x0f, 0x00, 0x38, 0x00, 0xc0, 0x02, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00,
}
};
IconRsc ICONID_ShiftLeft =
{
15, 15, FORMAT_MONOBITMAP, BLACK_INDEX, "ShiftLeft",
{
0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x01, 0x80,
0x0e, 0x00, 0x78, 0x03, 0xe0, 0x1f, 0x80, 0x0f,
0x80, 0x07, 0x80, 0x03, 0x80, 0x01, 0x80, 0x00,
0x80, 0x00, 0x00, 0x00, 0x00,
}
};
IconRsc ICONID_ShiftUp =
{
15, 15, FORMAT_MONOBITMAP, BLACK_INDEX, "ShiftUp",
{
0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x08, 0x00,
0x38, 0x00, 0x70, 0x01, 0xf0, 0x03, 0xe0, 0x0e,
0xe0, 0x18, 0xc0, 0x60, 0xc0, 0x80, 0x82, 0x00,
0x80, 0x00, 0x00, 0x00, 0x00
}
};
IconRsc ICONID_ShiftDown =
{
15, 15, FORMAT_MONOBITMAP, BLACK_INDEX, "ShiftDown",
{
0x00, 0x00, 0x00, 0x00, 0x80, 0x20, 0x80, 0x81,
0x83, 0x01, 0x8c, 0x03, 0xb8, 0x03, 0xe0, 0x07,
0xc0, 0x07, 0x00, 0x0e, 0x00, 0x08, 0x00, 0x10,
0x00, 0x00, 0x00, 0x00, 0x00,
}
};
/*----------------------------------------------------------------------+
| |
| Select Cell Dialog |
| |
+----------------------------------------------------------------------*/
#undef XC
#define XC (DCOORD_RESOLUTION/2) * ASPECT_SELECTCELL
DialogBoxRsc DIALOGID_SelectCell =
{
DIALOGATTR_DEFAULT | DIALOGATTR_MODAL,
42*XC+12*YC, 19*YC,
NOHELP, LHELP,
NOHOOK, NOPARENTID,
TXT_SelectCell,
{
{{ 10*XC, 1, 52*XC, 0}, Text, TEXTID_SelectCell, ON, 0, "", ""},
{{3*XC/2, 3*YC, 0, 0}, ListBox, LISTBOXID_SelectCell, ON, 0, "", ""},
{{ 39*XC, 3*YC, 12*YC, 12*YC}, Generic, GENERICID_SelectCell, ON, 0, "", ""},
{{25*XC, 16.3*YC, 8*XC, 0}, PushButton, PUSHBUTTONID_OK, ON, 0, "", ""},
{{35*XC, 16.3*YC, 8*XC, 0}, PushButton, PUSHBUTTONID_Cancel, ON, 0, "", ""},
}
};
/*----------------------------------------------------------------------+
| |
| List Items |
| |
+----------------------------------------------------------------------*/
DItem_ListBoxRsc LISTBOXID_SelectCell =
{
NOHELP, LHELP,
HOOKID_ListBox_SelectCell, NOARG,
0, 10, 0, "",
{
{8*XC, 6, ALIGN_LEFT, TXT_CellName},
{23*XC, 22, ALIGN_LEFT, TXT_CellDescr},
}
};
/*----------------------------------------------------------------------+
| |
| Generic Items |
| |
+----------------------------------------------------------------------*/
DItem_GenericRsc GENERICID_SelectCell =
{
NOHELP, MHELP, HOOKID_Generic_SelectCell, NOARG
};
/*----------------------------------------------------------------------+
| |
| Text Items |
| |
+----------------------------------------------------------------------*/
DItem_TextRsc TEXTID_SelectCell =
{
NOCMD, MCMD, NOSYNONYM,
NOHELP, MHELP,
NOHOOK, NOARG,
60, "%s", "%s", "", "", NOMASK,
TEXT_READONLY, "",
""
};