00001
00002
00003
00004
00005
00006
00007
00008
00009 #ifndef __WGMENU__
00010 #define __WGMENU__
00011
00012 #include <stdio.h>
00013 #ifndef STRICT
00014 #define STRICT
00015 #endif
00016
00017 #include <string.h>
00018
00019
00020 #include "wresource.h"
00021 #include "wcommon.h"
00022 #include <commdlg.h>
00023 #include <direct.h>
00024
00025
00026
00027 #include "../../../../string/includes/men_Sutils.h"
00028
00029
00030
00031 extern TW textwin;
00032
00033
00034 #define MAXSTR 255
00035 #define MACROLEN 5000
00036 #define MENUDEPTH 3
00037
00038
00039 #undef CMDMAX
00040 #undef CMDMIN
00041 #undef EOS
00042 #define CMDMIN 131
00043
00045 #define LOADSCG CMDMIN
00046 #define SAVESCG CMDMIN+1
00047 #define NEWFIG CMDMIN+2
00048 #define CLOSE CMDMIN+3
00049 #define SCIPS CMDMIN+4
00050 #define SCIPR CMDMIN+5
00051 #define PRINTSETUP CMDMIN+6
00052 #define PRINT CMDMIN+7
00053 #define UPDINI CMDMIN+8
00054
00055 #define SCIGSEL UPDINI+1
00056 #define TOOLBARGRAPH SCIGSEL+1
00057 #define REDRAW SCIGSEL+2
00058 #define CLEARWG SCIGSEL+3
00059 #define COPYCLIP SCIGSEL+4
00060 #define COPYCLIP1 SCIGSEL+5
00061
00062 #define ZOOM COPYCLIP1+1
00063 #define UNZOOM ZOOM+1
00064 #define ROT3D ZOOM+2
00065
00066 #define EOS ROT3D+1
00067
00068 #define CMDMAX EOS
00069
00070
00071 #define BUGGOTOCLEAN(str) \
00072 wsprintf(buf,str,nLine,ScilabGC->lpgw->szMenuName); \
00073 MessageBox(ScilabGC->hWndParent,(LPSTR) buf,ScilabGC->lpgw->Title,MB_ICONEXCLAMATION);\
00074 goto errorcleanup;
00075
00076
00077 static char *keyword[] =
00078 {
00079 "[TOOLBARGRAPH]","[NEWFIG]","[ZOOM]", "[UNZOOM]", "[ROT3D]", "[PRINTSETUP]", "[PRINT]", "[COPYCLIP]", "[COPYCLIP1]",
00080 "[REDRAW]", "[LOADSCG]", "[SAVESCG]", "[CLEARWG]", "[SCIPS]", "[SCIPR]",
00081 "[SCIGSEL]", "[UPDINI]", "[EOS]", "[CLOSE]",
00082 "{ENTER}", "{ESC}", "{TAB}",
00083 "{^A}", "{^B}", "{^C}", "{^D}", "{^E}", "{^F}", "{^G}", "{^H}",
00084 "{^I}", "{^J}", "{^K}", "{^L}", "{^M}", "{^N}", "{^O}", "{^P}",
00085 "{^Q}", "{^R}", "{^S}", "{^T}", "{^U}", "{^V}", "{^W}", "{^X}",
00086 "{^Y}", "{^Z}", "{^[}", "{^\\}", "{^]}", "{^^}", "{^_}",
00087 NULL};
00088
00089 static BYTE keyeq[] =
00090 {
00091 TOOLBARGRAPH,NEWFIG,ZOOM, UNZOOM, ROT3D, PRINTSETUP,PRINT, COPYCLIP, COPYCLIP1,
00092 REDRAW, LOADSCG, SAVESCG, CLEARWG, SCIPS, SCIPR, SCIGSEL, UPDINI, EOS,
00093 CLOSE,
00094 13, 27, 9,
00095 1, 2, 3, 4, 5, 6, 7, 8,
00096 9, 10, 11, 12, 13, 14, 15, 16,
00097 17, 18, 19, 20, 21, 22, 23, 24,
00098 25, 26, 28, 29, 30, 31,
00099 0 };
00100
00101
00102 static void ExploreMenu (HMENU hmen, BYTE ** macro);
00103 static void SciDelMenu (LPMW lpmw, char *name);
00104 static void SciChMenu (LPMW lpmw, char *name, char *new_name);
00105 static void SciSetMenu (HMENU hmen, char *name, int num, int flag);
00106 static void SciChMenu (LPMW lpmw, char *name, char *new_name);
00107 static void SciDelMenu (LPMW lpmw, char *name);
00108
00109 static void TranslateMacro (char *string);
00110 static void ExploreMenu (HMENU hmen, BYTE ** hmacro);
00111 static void scig_command_scilabgc (int number, void f (struct BCG *));
00112
00113 void SendGraphMacro (struct BCG *ScilabGC, UINT m);
00114 void ScilabMenuAction (char *buf);
00115 void write_scilab (char *buf);
00116 void LoadGraphMacros (struct BCG *ScilabGC);
00117 void CloseGraphMacros (struct BCG *ScilabGC);
00118
00119 void scig_h_copyclip (integer number);
00120 void scig_h_copyclip1 (integer number);
00121 void scig_print (integer number);
00122 void scig_export (integer number);
00123 void UpdateFileGraphNameMenu(struct BCG *ScilabGC);
00124
00125 int WGFindMenuPos (BYTE ** macros);
00126 int C2F (setmen) (integer * win_num, char *button_name,
00127 integer * entries, integer * ptrentries,
00128 integer * ne, integer * ierr);
00129 int C2F (unsmen) (integer * win_num, char *button_name, integer * entries,
00130 integer * ptrentries, integer * ne, integer * ierr);
00131
00132 EXPORT BOOL CALLBACK ExportStyleDlgProc (HWND hdlg, UINT wmsg, WPARAM wparam, LPARAM lparam);
00133
00134 BOOL ExportStyle (struct BCG * ScilabGC);
00135 void NewFigure(struct BCG * ScilabGC);
00136 int FindFreeGraphicWindow(struct BCG * ScilabGC);
00137 void RefreshMenus(struct BCG * ScilabGC);
00138 void CreateGedMenus(struct BCG * ScilabGC);
00139 BOOL IsEntityPickerMenu(struct BCG * ScilabGC,int id);
00140 #endif