WMENU.H File Reference

#include <windows.h>
#include <string.h>
#include "wresource.h"
#include "wcommon.h"
#include "wtext.h"

Include dependency graph for WMENU.H:

Go to the source code of this file.

Defines

#define MACROLEN   5000
#define MENUDEPTH   3
#define CMDMIN   129
#define NEWSCILAB   CMDMIN
#define EXEC   CMDMIN+1
#define OPEN   CMDMIN+2
#define GETF   CMDMIN+3
#define LOAD   CMDMIN+4
#define SAVE   CMDMIN+5
#define GETCWD   CMDMIN+6
#define CHDIR   CMDMIN+7
#define PRINTSETUP   CMDMIN+8
#define PRINT   CMDMIN+9
#define EXIT   CMDMIN+10
#define SELECTALL   EXIT+1
#define MCOPY   SELECTALL+1
#define PASTE   SELECTALL+2
#define EMPTYCLIPBOARD   SELECTALL+3
#define M_CTRL_C   EOS+1
#define M_CTRL_U   M_CTRL_C+1
#define M_CTRL_P   M_CTRL_C+2
#define M_CTRL_B   M_CTRL_C+3
#define M_CTRL_F   M_CTRL_C+4
#define M_CTRL_A   M_CTRL_C+5
#define M_CTRL_E   M_CTRL_C+6
#define M_CTRL_H   M_CTRL_C+7
#define M_CTRL_D   M_CTRL_C+8
#define M_CTRL_W   M_CTRL_C+9
#define M_CTRL_K   M_CTRL_C+10
#define M_CTRL_L   M_CTRL_C+11
#define M_CTRL_N   M_CTRL_C+12
#define FRENCH   EMPTYCLIPBOARD+1
#define ENGLISH   FRENCH+1
#define TEXTCOLOR   FRENCH+2
#define BACKGROUNDCOLOR   FRENCH+3
#define SYSTEMCOLOR   FRENCH+4
#define FILESASSOCIATION   FRENCH+5
#define TOOLBAR   FRENCH+6
#define CHOOSETHEFONT   FRENCH+7
#define CLEARHISTORY   FRENCH+8
#define CLEARCOMMANDWINDOW   FRENCH+9
#define CONSOLE   FRENCH+10
#define RESTART   CONSOLE+1
#define PAUSE   RESTART+1
#define RESUME   RESTART+2
#define ABORT   RESTART+3
#define SCIPAD   ABORT+1
#define HELP   SCIPAD+1
#define CONFIGBROWSER   HELP+1
#define DEMOS   HELP+2
#define NEWSGROUP   HELP+3
#define EMAIL   HELP+4
#define WEB   HELP+5
#define CONTRIBUTIONS   HELP+6
#define BUGZILLA   HELP+7
#define ABOUT   HELP+8
#define EOS   ABOUT+1
#define CMDMAX   M_CTRL_N
#define URLNEWSGROUP   "http://groups.google.com/groups?dq=&num=25&hl=en&lr=&ie=UTF-8&group=comp.soft-sys.math.scilab"
#define URLCONTRIBUTIONS   "http://scilabsoft.inria.fr/contrib/index_contrib.php?page=howto.html"
#define URL   "http://www.scilab.org"
#define URLBUGZILLA   "http://scilabsoft.inria.fr/cgi-bin/bugzilla_bug_II/index.cgi"
#define MAILTO   "Scilab@inria.fr"
#define CCMAILTO   ""
#define SUBJECT   "Doctor Scilab Please Help me"
#define NEWSTRING(x)
#define BUGGOTOCLEAN(str)

Functions

EXPORT BOOL CALLBACK InputBoxDlgProc (HWND, UINT, WPARAM, LPARAM)
EXPORT LRESULT CALLBACK MenuButtonProc (HWND, UINT, WPARAM, LPARAM)
void Callback_NEWSCILAB (void)
void Callback_EXEC (void)
void Callback_OPEN (void)
void Callback_GETF (void)
void Callback_LOAD (void)
void Callback_SAVE (void)
void Callback_CHDIR (void)
void Callback_GETCWD (void)
void Callback_SELECTALL (void)
void Callback_EMPTYCLIPBOARD (void)
void Callback_MCOPY (void)
void Callback_PASTE (void)
void Callback_PRINTSETUP (void)
void Callback_PRINT (void)
void Callback_TOOLBAR (void)
void Callback_FRENCH (void)
void Callback_ENGLISH (void)
void Callback_TEXTCOLOR (void)
void Callback_BACKGROUNDCOLOR (void)
void Callback_SYSTEMCOLOR (void)
void Callback_FILESASSOCIATIONBOX (void)
void Callback_CHOOSETHEFONT (void)
void Callback_RESTART (void)
void Callback_ABORT (void)
void Callback_PAUSE (void)
void Callback_RESUME (void)
void Callback_CONSOLE (void)
void Callback_SCIPAD (void)
void Callback_HELP (void)
void Callback_DEMOS (void)
void Callback_WEB (void)
void Callback_CONTRIBUTIONS (void)
void Callback_BUGZILLA (void)
void Callback_EMAIL (void)
void Callback_NEWSGROUP (void)
void Callback_ABOUT (void)
void Callback_CLEARCOMMANDWINDOW (void)
void Callback_CONFIGUREBROWSER (void)
void Callback_CLEARHISTORY (void)
void SendMacro (LPTW lptw, UINT m)
BOOL SciOpenSave (HWND hWndParent, BYTE **s, BOOL save, char **d, int *ierr)
void MenuFixCurrentWin (int ivalue)
GFILEGfopen (LPSTR lpszFileName, int fnOpenMode)
void Gfclose (GFILE *gfile)
int Gfgets (LPSTR lp, int size, GFILE *gfile)
int GetLine (char *buffer, int len, GFILE *gfile)
void LeftJustify (char *d, char *s)
void TranslateMacro (char *string)
void LoadMacros (LPTW lptw)
void CloseMacros (LPTW lptw)
BOOL OpenSaveSCIFile (HWND hWndParent, char *titre, BOOL read, char *FileExt, char *file)
void ReplaceSlash (char *pathout, char *pathin)
void SendCTRLandAKey (int code)
void ResetMenu (void)
void ShowToolBar (LPTW lptw)
void HideToolBar (LPTW lptw)
void ToolBarOnOff (LPTW lptw)
void ReLoadMenus (LPTW lptw)
void UpdateFileNameMenu (LPTW lptw)
void CreateMyTooltip (HWND hwnd, char ToolTipString[30])
void SwitchLanguage (LPTW lptw)
void CreateButton (LPTW lptw, char *ButtonText[BUTTONMAX], int index, int ButtonSizeX, int ButtonSizeY)
int GetXPosButton (LPTW lptw, int index, int SizeXButtonText, int SizeXButtonIcon)
void ConfigureScilabStar (int LangCode)
int ModifyFile (char *fichier, char *motclef, char *chaine)
int HideToolBarWin32 (int WinNum)
void CutLineForDisplay (char *CutLine, char *Line, int NumberOfCharByLine)
void SetLanguageMenu (char *Language)
int GetLanguageCodeInScilabDotStar (void)

Variables

static char * keyword []
static BYTE keyeq []


Define Documentation

#define ABORT   RESTART+3

Definition at line 76 of file WMENU.H.

Referenced by SendMacro().

#define ABOUT   HELP+8

Definition at line 88 of file WMENU.H.

Referenced by SendMacro().

#define BACKGROUNDCOLOR   FRENCH+3

Definition at line 64 of file WMENU.H.

Referenced by SendMacro().

#define BUGGOTOCLEAN ( str   ) 

Value:

wsprintf(buf,str,nLine,lpmw->szMenuName); \
      MessageBox(lptw->hWndParent,(LPSTR) buf,lptw->Title,MB_ICONEXCLAMATION);\
      goto errorcleanup;

Definition at line 106 of file WMENU.H.

#define BUGZILLA   HELP+7

Definition at line 87 of file WMENU.H.

Referenced by SendMacro().

#define CCMAILTO   ""

Definition at line 99 of file WMENU.H.

Referenced by Callback_EMAIL().

#define CHDIR   CMDMIN+7

Definition at line 37 of file WMENU.H.

Referenced by SendMacro().

#define CHOOSETHEFONT   FRENCH+7

Definition at line 68 of file WMENU.H.

Referenced by SendMacro().

#define CLEARCOMMANDWINDOW   FRENCH+9

Definition at line 70 of file WMENU.H.

Referenced by SendMacro().

#define CLEARHISTORY   FRENCH+8

Definition at line 69 of file WMENU.H.

Referenced by SendMacro().

#define CMDMAX   M_CTRL_N

Definition at line 92 of file WMENU.H.

#define CMDMIN   129

Definition at line 28 of file WMENU.H.

#define CONFIGBROWSER   HELP+1

Definition at line 81 of file WMENU.H.

Referenced by SendMacro().

#define CONSOLE   FRENCH+10

Definition at line 71 of file WMENU.H.

Referenced by SendMacro().

#define CONTRIBUTIONS   HELP+6

Definition at line 86 of file WMENU.H.

Referenced by SendMacro().

#define DEMOS   HELP+2

Definition at line 82 of file WMENU.H.

Referenced by SendMacro().

#define EMAIL   HELP+4

Definition at line 84 of file WMENU.H.

Referenced by SendMacro().

#define EMPTYCLIPBOARD   SELECTALL+3

Definition at line 45 of file WMENU.H.

Referenced by SendMacro().

#define ENGLISH   FRENCH+1

Definition at line 62 of file WMENU.H.

Referenced by SendMacro().

#define EOS   ABOUT+1

Definition at line 90 of file WMENU.H.

#define EXEC   CMDMIN+1

Definition at line 31 of file WMENU.H.

Referenced by SendMacro().

#define EXIT   CMDMIN+10

Definition at line 40 of file WMENU.H.

Referenced by SendMacro().

#define FILESASSOCIATION   FRENCH+5

Definition at line 66 of file WMENU.H.

Referenced by SendMacro().

#define FRENCH   EMPTYCLIPBOARD+1

Definition at line 61 of file WMENU.H.

Referenced by SendMacro().

#define GETCWD   CMDMIN+6

Definition at line 36 of file WMENU.H.

#define GETF   CMDMIN+3

Definition at line 33 of file WMENU.H.

Referenced by SendMacro().

#define HELP   SCIPAD+1

Definition at line 80 of file WMENU.H.

Referenced by SendMacro().

#define LOAD   CMDMIN+4

Definition at line 34 of file WMENU.H.

Referenced by SendMacro().

#define M_CTRL_A   M_CTRL_C+5

Definition at line 52 of file WMENU.H.

Referenced by SendMacro().

#define M_CTRL_B   M_CTRL_C+3

Definition at line 50 of file WMENU.H.

Referenced by SendMacro().

#define M_CTRL_C   EOS+1

Definition at line 47 of file WMENU.H.

Referenced by SendMacro().

#define M_CTRL_D   M_CTRL_C+8

Definition at line 55 of file WMENU.H.

Referenced by SendMacro().

#define M_CTRL_E   M_CTRL_C+6

Definition at line 53 of file WMENU.H.

Referenced by SendMacro().

#define M_CTRL_F   M_CTRL_C+4

Definition at line 51 of file WMENU.H.

Referenced by SendMacro().

#define M_CTRL_H   M_CTRL_C+7

Definition at line 54 of file WMENU.H.

Referenced by SendMacro().

#define M_CTRL_K   M_CTRL_C+10

Definition at line 57 of file WMENU.H.

Referenced by SendMacro().

#define M_CTRL_L   M_CTRL_C+11

Definition at line 58 of file WMENU.H.

Referenced by SendMacro().

#define M_CTRL_N   M_CTRL_C+12

Definition at line 59 of file WMENU.H.

#define M_CTRL_P   M_CTRL_C+2

Definition at line 49 of file WMENU.H.

Referenced by SendMacro().

#define M_CTRL_U   M_CTRL_C+1

Definition at line 48 of file WMENU.H.

Referenced by SendMacro().

#define M_CTRL_W   M_CTRL_C+9

Definition at line 56 of file WMENU.H.

Referenced by SendMacro().

#define MACROLEN   5000

Definition at line 20 of file WMENU.H.

#define MAILTO   "Scilab@inria.fr"

Definition at line 98 of file WMENU.H.

Referenced by Callback_EMAIL().

#define MCOPY   SELECTALL+1

Definition at line 43 of file WMENU.H.

Referenced by genmcopy(), and SendMacro().

#define MENUDEPTH   3

Definition at line 22 of file WMENU.H.

#define NEWSCILAB   CMDMIN

Definition at line 30 of file WMENU.H.

Referenced by SendMacro().

#define NEWSGROUP   HELP+3

Definition at line 83 of file WMENU.H.

Referenced by SendMacro().

#define NEWSTRING ( x   ) 

Value:

if ((x=MALLOC((MAXSTR+1)*sizeof(LPTR))) == (char *)NULL) \
{ *ierr=1;return(FALSE);}

Definition at line 103 of file WMENU.H.

Referenced by SciOpenSave().

#define OPEN   CMDMIN+2

Definition at line 32 of file WMENU.H.

Referenced by SendMacro().

#define PASTE   SELECTALL+2

Definition at line 44 of file WMENU.H.

Referenced by SendMacro().

#define PAUSE   RESTART+1

Definition at line 74 of file WMENU.H.

Referenced by SendMacro().

#define PRINT   CMDMIN+9

Definition at line 39 of file WMENU.H.

#define PRINTSETUP   CMDMIN+8

Definition at line 38 of file WMENU.H.

#define RESTART   CONSOLE+1

Definition at line 73 of file WMENU.H.

Referenced by SendMacro().

#define RESUME   RESTART+2

Definition at line 75 of file WMENU.H.

Referenced by SendMacro().

#define SAVE   CMDMIN+5

Definition at line 35 of file WMENU.H.

Referenced by SendMacro().

#define SCIPAD   ABORT+1

Definition at line 78 of file WMENU.H.

Referenced by SendMacro().

#define SELECTALL   EXIT+1

Definition at line 42 of file WMENU.H.

Referenced by SendMacro().

#define SUBJECT   "Doctor Scilab Please Help me"

Definition at line 100 of file WMENU.H.

Referenced by Callback_EMAIL().

#define SYSTEMCOLOR   FRENCH+4

Definition at line 65 of file WMENU.H.

Referenced by SendMacro().

#define TEXTCOLOR   FRENCH+2

Definition at line 63 of file WMENU.H.

Referenced by SendMacro().

#define TOOLBAR   FRENCH+6

Definition at line 67 of file WMENU.H.

Referenced by SendMacro().

#define URL   "http://www.scilab.org"

Definition at line 96 of file WMENU.H.

Referenced by Callback_WEB().

#define URLBUGZILLA   "http://scilabsoft.inria.fr/cgi-bin/bugzilla_bug_II/index.cgi"

Definition at line 97 of file WMENU.H.

Referenced by Callback_BUGZILLA().

#define URLCONTRIBUTIONS   "http://scilabsoft.inria.fr/contrib/index_contrib.php?page=howto.html"

Definition at line 95 of file WMENU.H.

Referenced by Callback_CONTRIBUTIONS().

#define URLNEWSGROUP   "http://groups.google.com/groups?dq=&num=25&hl=en&lr=&ie=UTF-8&group=comp.soft-sys.math.scilab"

Definition at line 94 of file WMENU.H.

Referenced by Callback_NEWSGROUP().

#define WEB   HELP+5

Definition at line 85 of file WMENU.H.

Referenced by SendMacro().


Function Documentation

void Callback_ABORT ( void   ) 

Definition at line 489 of file wmenu.c.

References CTRLU, SendCTRLandAKey(), and StoreCommand1().

Referenced by SendMacro().

00490 {
00491         SendCTRLandAKey(CTRLU);
00492         StoreCommand1("abort;",1);
00493 }

Here is the call graph for this function:

Here is the caller graph for this function:

void Callback_ABOUT ( void   ) 

Definition at line 579 of file wmenu.c.

References AboutBox(), GetTextWinScilab(), tagTW::hWndParent, IsWindowInterface(), and NULL.

Referenced by C2F(), and SendMacro().

00580 {
00581         if (IsWindowInterface())
00582         {
00583                 LPTW lptw=GetTextWinScilab();
00584                 AboutBox(lptw->hWndParent);
00585         }
00586         else AboutBox(NULL);
00587 }

Here is the call graph for this function:

Here is the caller graph for this function:

void Callback_BACKGROUNDCOLOR ( void   ) 

Definition at line 422 of file wmenu.c.

References B, tagTW::bSysColors, ChooseColorBox(), G, GetIhmTextBackgroundColor(), GetTextWinScilab(), R, SetIhmTextBackgroundColor(), and TRUE.

Referenced by SendMacro().

00423 {
00424         int R,G,B;
00425 
00426         R=GetRValue(GetIhmTextBackgroundColor());
00427         G=GetGValue(GetIhmTextBackgroundColor());
00428         B=GetBValue(GetIhmTextBackgroundColor());
00429 
00430         if (ChooseColorBox(&R,&G,&B))
00431         {
00432                 LPTW lptw=GetTextWinScilab();
00433 
00434                 SetIhmTextBackgroundColor(R,G,B,TRUE);
00435                 lptw->bSysColors=0;
00436         }
00437 }

Here is the call graph for this function:

Here is the caller graph for this function:

void Callback_BUGZILLA ( void   ) 

Definition at line 557 of file wmenu.c.

References error, int, MSG_WARNING22, MSG_WARNING24, NULL, SW_SHOWNORMAL, and URLBUGZILLA.

Referenced by SendMacro().

00558 {
00559         int error =(int)ShellExecute(NULL, "open", URLBUGZILLA, NULL, NULL, SW_SHOWNORMAL);
00560         if (error<= 32) MessageBox(NULL,MSG_WARNING24,MSG_WARNING22,MB_ICONWARNING);
00561 }

Here is the caller graph for this function:

void Callback_CHDIR ( void   ) 

Definition at line 223 of file wmenu.c.

References tagMW::CodeLanguage, command, CTRLU, CutLineForDisplay(), GetTextWinScilab(), tagTW::hWndParent, tagTW::lpmw, MAX_PATH, MSG_SCIMSG38, MSG_SCIMSG39, NULL, NumberCharByLineInChdirBox, SendCTRLandAKey(), and StoreCommand1().

Referenced by SendMacro().

00224 {
00225         #define NumberCharByLineInChdirBox      56
00226         BROWSEINFO InfoBrowserDirectory;
00227         char Path[MAX_PATH];
00228         char PathToDisplay[MAX_PATH*2];
00229         char command[MAX_PATH]; 
00230         char TextPath[MAX_PATH*2];
00231         
00232         LPITEMIDLIST pidl; 
00233                         
00234         LPTW lptw=GetTextWinScilab();
00235                 
00236         GetCurrentDirectory(MAX_PATH,Path);
00237         CutLineForDisplay(PathToDisplay,Path,NumberCharByLineInChdirBox);               
00238         InfoBrowserDirectory.hwndOwner = lptw->hWndParent; 
00239         InfoBrowserDirectory.pidlRoot = NULL; 
00240         switch (lptw->lpmw->CodeLanguage)
00241         { 
00242                 case 1:
00243                 if (lstrlen(Path) < NumberCharByLineInChdirBox)
00244                 {
00245                         wsprintf(TextPath,"%s\n\n%s",MSG_SCIMSG38,PathToDisplay);
00246                 }
00247                 else
00248                 {
00249                         if ( lstrlen(Path) > (NumberCharByLineInChdirBox*2) )
00250                         {
00251                                 wsprintf(TextPath,"%s",MSG_SCIMSG38);
00252                         }
00253                         else
00254                         wsprintf(TextPath,"%s\n%s",MSG_SCIMSG38,PathToDisplay);
00255                 }
00256                 break;
00257                                 
00258                 case 0:default:
00259                 if (lstrlen(Path)<NumberCharByLineInChdirBox)
00260                 {
00261                         wsprintf(TextPath,"%s\n\n%s",MSG_SCIMSG39,PathToDisplay);
00262                 }
00263                 else
00264                 {
00265                         if ( lstrlen(Path) > (NumberCharByLineInChdirBox*2) )
00266                         {
00267                                 wsprintf(TextPath,"%s",MSG_SCIMSG39);
00268                         }
00269                         else
00270                         wsprintf(TextPath,"%s\n%s",MSG_SCIMSG39,PathToDisplay);
00271                 }
00272                 break;
00273         }
00274                 
00275         InfoBrowserDirectory.lpszTitle=TextPath;
00276         InfoBrowserDirectory.pszDisplayName=Path; 
00277         InfoBrowserDirectory.ulFlags = BIF_STATUSTEXT|BIF_RETURNONLYFSDIRS; 
00278         InfoBrowserDirectory.lpfn =NULL;
00279 
00280 
00281         pidl=SHBrowseForFolder(&InfoBrowserDirectory);
00282         if (pidl!=NULL)
00283         {
00284                 SHGetPathFromIDList(pidl, Path); 
00285                 SendCTRLandAKey(CTRLU);
00286                 wsprintf(command,"chdir('%s');",Path);
00287                 StoreCommand1 (command,1);
00288                 //WriteIntoScilab(lptw,command);
00289         }
00290 
00291 }

Here is the call graph for this function:

Here is the caller graph for this function:

void Callback_CHOOSETHEFONT ( void   ) 

Definition at line 461 of file wmenu.c.

References GetTextWinScilab(), and TextSelectFont().

Referenced by SendMacro().

00462 {
00463         LPTW lptw=GetTextWinScilab();
00464 
00465         TextSelectFont (lptw);
00466 }

Here is the call graph for this function:

Here is the caller graph for this function:

void Callback_CLEARCOMMANDWINDOW ( void   ) 

Definition at line 589 of file wmenu.c.

References ClearCommandWindow(), GetTextWinScilab(), and TRUE.

Referenced by SendMacro().

00590 {
00591         LPTW lptw=GetTextWinScilab();
00592 
00593         ClearCommandWindow(lptw,TRUE);
00594 }

Here is the call graph for this function:

Here is the caller graph for this function:

void Callback_CLEARHISTORY ( void   ) 

Definition at line 602 of file wmenu.c.

References AddHistory(), GetCommentDateSession(), MAXBUF, reset_history(), and TRUE.

Referenced by SendMacro().

00603 {
00604         #define MAXBUF  1024
00605         char Commentline[MAXBUF];
00606 
00607         reset_history();
00608 
00609         GetCommentDateSession(Commentline,TRUE);                
00610         AddHistory (Commentline);
00611 
00612 }

Here is the call graph for this function:

Here is the caller graph for this function:

void Callback_CONFIGUREBROWSER ( void   ) 

Definition at line 596 of file wmenu.c.

References CTRLU, SendCTRLandAKey(), and StoreCommand1().

Referenced by SendMacro().

00597 {
00598         SendCTRLandAKey(CTRLU);
00599         StoreCommand1("help_menu(3);",0);
00600 }

Here is the call graph for this function:

Here is the caller graph for this function:

void Callback_CONSOLE ( void   ) 

Definition at line 508 of file wmenu.c.

References SwitchConsole().

Referenced by SendMacro().

00509 {
00510         SwitchConsole();
00511 }

Here is the call graph for this function:

Here is the caller graph for this function:

void Callback_CONTRIBUTIONS ( void   ) 

Definition at line 551 of file wmenu.c.

References error, int, MSG_WARNING22, MSG_WARNING24, NULL, SW_SHOWNORMAL, and URLCONTRIBUTIONS.

Referenced by SendMacro().

00552 {
00553         int error =(int)ShellExecute(NULL, "open", URLCONTRIBUTIONS, NULL, NULL, SW_SHOWNORMAL);
00554         if (error<= 32) MessageBox(NULL,MSG_WARNING24,MSG_WARNING22,MB_ICONWARNING);
00555 }

Here is the caller graph for this function:

void Callback_DEMOS ( void   ) 

Definition at line 537 of file wmenu.c.

References CTRLU, GetTextWinScilab(), SendCTRLandAKey(), and WriteIntoScilab().

Referenced by SendMacro().

00538 {
00539         LPTW lptw=GetTextWinScilab();
00540 
00541         SendCTRLandAKey(CTRLU);
00542         WriteIntoScilab(lptw,"scilab_demos();");
00543 }

Here is the call graph for this function:

Here is the caller graph for this function:

void Callback_EMAIL ( void   ) 

Definition at line 563 of file wmenu.c.

References CCMAILTO, error, int, MAILTO, MAX_PATH, Message(), MSG_WARNING22, MSG_WARNING25, NULL, SUBJECT, and SW_SHOWNORMAL.

Referenced by SendMacro().

00564 {
00565         char Message[MAX_PATH];
00566         int error;
00567                         
00568         wsprintf(Message,"mailto:%s?Subject=%s&CC=%s&body=%s",MAILTO, SUBJECT,CCMAILTO,"Message to Doctor Scilab");
00569         error =(int)ShellExecute(NULL, "open",Message,NULL,NULL,SW_SHOWNORMAL);
00570         if (error<= 32) MessageBox(NULL,MSG_WARNING25,MSG_WARNING22,MB_ICONWARNING);
00571 }

Here is the call graph for this function:

Here is the caller graph for this function:

void Callback_EMPTYCLIPBOARD ( void   ) 

Definition at line 620 of file wmenu.c.

References CleanClipboard(), and GetTextWinScilab().

00621 {
00622         LPTW lptw=GetTextWinScilab();
00623         CleanClipboard(lptw);
00624 
00625 }

Here is the call graph for this function:

void Callback_ENGLISH ( void   ) 

Definition at line 395 of file wmenu.c.

References tagMW::CodeLanguage, GetTextWinScilab(), tagTW::lpmw, and StoreCommand1().

Referenced by SendMacro().

00396 {
00397         LPTW lptw=GetTextWinScilab();
00398         
00399         if (lptw->lpmw->CodeLanguage!=0)
00400                 {
00401                         StoreCommand1 ("setlanguage('en');",0);
00402                 }
00403 }

Here is the call graph for this function:

Here is the caller graph for this function:

void Callback_EXEC ( void   ) 

Definition at line 155 of file wmenu.c.

References command, CTRLU, GetTextWinScilab(), tagTW::hWndParent, MAX_PATH, MSG_SCIMSG34, OpenSaveSCIFile(), SendCTRLandAKey(), StoreCommand1(), and TRUE.

Referenced by SendMacro().

00156 {
00157         char Fichier[MAX_PATH];
00158         char command[MAX_PATH];
00159         
00160         LPTW lptw=GetTextWinScilab();
00161 
00162         _try {
00163                 if ( OpenSaveSCIFile(lptw->hWndParent,"Exec",TRUE,"Files *.sce;*.sci\0*.sci;*.sce\0Files *.sci\0*.sci\0Files *.sce\0*.sce\0All *.*\0*.*\0",Fichier) == TRUE)
00164                 {
00165                         SendCTRLandAKey(CTRLU);
00166                         wsprintf(command,MSG_SCIMSG34,Fichier);
00167                         StoreCommand1 (command,1);
00168                 }       
00169         }
00170         _except (EXCEPTION_EXECUTE_HANDLER) 
00171         {
00172                 
00173         }
00174                                 
00175         
00176 }

Here is the call graph for this function:

Here is the caller graph for this function:

void Callback_FILESASSOCIATIONBOX ( void   ) 

Definition at line 448 of file wmenu.c.

00449 {
00450         if (IsWindowInterface())
00451         {
00452                 LPTW lptw=GetTextWinScilab();
00453                 FilesAssociationBox(lptw->hWndParent);
00454         }
00455         else
00456         {
00457                 FilesAssociationBox(NULL);
00458         }
00459 }

void Callback_FRENCH ( void   ) 

Definition at line 385 of file wmenu.c.

References tagMW::CodeLanguage, GetTextWinScilab(), tagTW::lpmw, and StoreCommand1().

Referenced by SendMacro().

00386 {
00387         LPTW lptw=GetTextWinScilab();
00388         
00389         if (lptw->lpmw->CodeLanguage!=1)
00390                 {
00391                         StoreCommand1 ("setlanguage('fr');",0);
00392                 }
00393 }

Here is the call graph for this function:

Here is the caller graph for this function:

void Callback_GETCWD ( void   ) 

Definition at line 293 of file wmenu.c.

References command, CTRLU, FREE, GetCurrentPrompt(), IsToThePrompt(), MALLOC, NULL, save_prompt, SendCTRLandAKey(), and StoreCommand().

Referenced by SendMacro().

00294 {
00295         char *command=NULL;
00296         if (IsToThePrompt())
00297         {
00298                 char save_prompt[10];
00299                 SendCTRLandAKey(CTRLU);
00300                 GetCurrentPrompt(save_prompt);
00301                 command=(char*)MALLOC((strlen("printf('\n\n %%s\n\n%s',getcwd())")+strlen(save_prompt))*sizeof(char));
00302                 wsprintf(command,"printf('\n\n %%s\n\n%s',getcwd())",save_prompt);
00303         }
00304         else
00305         {
00306                 command=(char*)MALLOC((strlen("printf('\n\n %%s\n\n%s',getcwd())"))*sizeof(char));
00307                 wsprintf(command,"printf('\n\n %%s\n\n',getcwd())");
00308         }
00309 
00310         StoreCommand (command);
00311         if (command) { FREE(command);command=NULL; }
00312                         
00313 }

Here is the call graph for this function:

Here is the caller graph for this function:

void Callback_GETF ( void   ) 

Definition at line 178 of file wmenu.c.

References command, CTRLU, GetTextWinScilab(), tagTW::hWndParent, MAX_PATH, MSG_SCIMSG35, OpenSaveSCIFile(), SendCTRLandAKey(), StoreCommand1(), and TRUE.

Referenced by SendMacro().

00179 {
00180         char Fichier[MAX_PATH];
00181         char command[MAX_PATH];
00182         
00183         LPTW lptw=GetTextWinScilab();
00184                                 
00185         if ( OpenSaveSCIFile(lptw->hWndParent,"Getf",TRUE,"Files *.sci\0*.sci\0All *.*\0*.*\0",Fichier) == TRUE)
00186         {
00187                 SendCTRLandAKey(CTRLU);
00188                 wsprintf(command,MSG_SCIMSG35,Fichier);
00189                 StoreCommand1 (command,1);
00190         }
00191 }

Here is the call graph for this function:

Here is the caller graph for this function:

void Callback_HELP ( void   ) 

Definition at line 525 of file wmenu.c.

References CTRLU, FALSE, IsToThePrompt(), PutLineInBuffer, StoreCommand(), and StoreCommand1().

Referenced by SendMacro().

00526 {
00527         char Command[512];
00528         extern BOOL PutLineInBuffer;
00529         wsprintf(Command,"%chelp();",CTRLU);
00530 
00531         PutLineInBuffer=FALSE;
00532         if (IsToThePrompt ()) StoreCommand1(Command,1);
00533         else StoreCommand("help();");
00534         PutLineInBuffer=FALSE;
00535 }

Here is the call graph for this function:

Here is the caller graph for this function:

void Callback_LOAD ( void   ) 

Definition at line 193 of file wmenu.c.

References command, CTRLU, GetTextWinScilab(), tagTW::hWndParent, MAX_PATH, MSG_SCIMSG36, OpenSaveSCIFile(), SendCTRLandAKey(), StoreCommand1(), and TRUE.

Referenced by SendMacro().

00194 {
00195         char Fichier[MAX_PATH];
00196         char command[MAX_PATH];
00197                                 
00198         LPTW lptw=GetTextWinScilab();
00199                                 
00200         if ( OpenSaveSCIFile(lptw->hWndParent,"Load",TRUE,"Files *.sav;*.bin\0*.sav;*.bin\0Files *.sav\0*.sav\0Files *.bin\0*.bin\0All *.*\0*.*\0",Fichier) == TRUE)
00201         {
00202                 SendCTRLandAKey(CTRLU);
00203             wsprintf(command,MSG_SCIMSG36,Fichier);
00204                 StoreCommand1 (command,1);
00205         }
00206 }

Here is the call graph for this function:

Here is the caller graph for this function:

void Callback_MCOPY ( void   ) 

Definition at line 315 of file wmenu.c.

References GetTextWinScilab(), HasAZoneTextSelected(), MSG_SCIMSG40, MSG_SCIMSG41, MSG_SCIMSG42, TextCopyClip(), and TRUE.

00316 {
00317         LPTW lptw=GetTextWinScilab();
00318         
00319         if ( HasAZoneTextSelected(lptw) == TRUE )TextCopyClip (lptw);
00320         else 
00321         {
00322                 if (lptw->lpmw->CodeLanguage == 0)
00323                 {
00324                         MessageBox(lptw->hWndParent,MSG_SCIMSG40,MSG_SCIMSG42,MB_ICONINFORMATION);
00325                 }
00326                 else
00327                 {
00328                         MessageBox(lptw->hWndParent,MSG_SCIMSG41,MSG_SCIMSG42,MB_ICONINFORMATION);
00329                 }
00330         }
00331 }

Here is the call graph for this function:

void Callback_NEWSCILAB ( void   ) 

Definition at line 81 of file wmenu.c.

References FALSE, FREE, MALLOC, MAX_PATH, memset(), MSG_WARNING22, MSG_WARNING23, NULL, putenv, and ScilexWindowName.

Referenced by SendMacro().

00082 {
00083         STARTUPINFO start;
00084         SECURITY_ATTRIBUTES sec_attrs;
00085         PROCESS_INFORMATION child;
00086         char ScilexName[MAX_PATH];
00087         /* Windows NT */
00088         char *VarEnvironmnt=NULL;
00089         extern char ScilexWindowName[MAX_PATH];
00090                         
00091         GetModuleFileName (NULL,ScilexName, MAX_PATH);
00092 
00093         memset (&start, 0, sizeof (start));
00094         start.cb = sizeof (start);
00095         start.dwFlags = STARTF_USESHOWWINDOW;
00096         start.wShowWindow = SW_SHOWMINIMIZED;
00097         sec_attrs.nLength = sizeof (sec_attrs);
00098         sec_attrs.lpSecurityDescriptor = NULL;
00099         sec_attrs.bInheritHandle = FALSE;
00100 
00101 
00102         VarEnvironmnt=(char*)MALLOC((strlen("SCILAB_CREATOR=")+strlen(ScilexWindowName)+1)*sizeof(char));
00103         wsprintf(VarEnvironmnt,"SCILAB_CREATOR=%s",ScilexWindowName);
00104         putenv(VarEnvironmnt);
00105         if (VarEnvironmnt) 
00106         {
00107                 FREE(VarEnvironmnt);
00108                 VarEnvironmnt=NULL;
00109         }
00110                 
00111         if (CreateProcess (ScilexName,"",&sec_attrs, NULL, FALSE, CREATE_NEW_CONSOLE,NULL, NULL, &start, &child))
00112         {
00113                 CloseHandle (child.hThread);
00114                 CloseHandle (child.hProcess);
00115         }
00116         else MessageBox(NULL,MSG_WARNING23,MSG_WARNING22,MB_ICONWARNING);
00117 }

Here is the call graph for this function:

Here is the caller graph for this function:

void Callback_NEWSGROUP ( void   ) 

Definition at line 573 of file wmenu.c.

References error, int, MSG_WARNING22, MSG_WARNING24, NULL, SW_SHOWNORMAL, and URLNEWSGROUP.

Referenced by SendMacro().

00574 {
00575         int error =(int)ShellExecute(NULL, "open", URLNEWSGROUP, NULL, NULL, SW_SHOWNORMAL);
00576         if (error<= 32) MessageBox(NULL,MSG_WARNING24,MSG_WARNING22,MB_ICONWARNING);
00577 }

Here is the caller graph for this function:

void Callback_OPEN ( void   ) 

Definition at line 119 of file wmenu.c.

References tagMW::CodeLanguage, command, CTRLU, FALSE, File(), GetTextWinScilab(), tagTW::hWndParent, IsToThePrompt(), tagTW::lpmw, MAX_PATH, MSG_SCIMSG32, MSG_SCIMSG33, OpenSaveSCIFile(), PutLineInBuffer, StoreCommand(), StoreCommand1(), and TRUE.

Referenced by SendMacro().

00120 {
00121         char File[MAX_PATH];
00122         char ShortFile[MAX_PATH];
00123         char command[MAX_PATH];
00124         char TitleText[32];
00125 
00126         LPTW lptw=GetTextWinScilab();
00127         
00128 
00129         switch (lptw->lpmw->CodeLanguage)
00130         {
00131                 case 1:
00132                         strcpy(TitleText,MSG_SCIMSG32);
00133                         break;
00134                 case 0:default:
00135                         strcpy(TitleText,MSG_SCIMSG33);
00136                         break;
00137         }
00138                                 
00139         if ( OpenSaveSCIFile(lptw->hWndParent,TitleText,TRUE,"Files *.sce;*.sci\0*.sci;*.sce\0Files *.sci\0*.sci\0Files *.sce\0*.sce\0All *.*\0*.*\0",File) == TRUE)
00140         {
00141                 extern BOOL PutLineInBuffer;
00142                 char CommandBis[512];
00143                 GetShortPathName(File,ShortFile,MAX_PATH);
00144                 wsprintf(command,"%cscipad('%s');",CTRLU,ShortFile);
00145                 wsprintf(CommandBis,"scipad('%s');",ShortFile);
00146 
00147                 PutLineInBuffer=FALSE;
00148                 if (IsToThePrompt ()) StoreCommand1(command,1);
00149                 else StoreCommand(CommandBis);
00150                 PutLineInBuffer=FALSE;
00151                 
00152         }
00153 }

Here is the call graph for this function:

Here is the caller graph for this function:

void Callback_PASTE ( void   ) 

Definition at line 333 of file wmenu.c.

References FALSE, GetTextWinScilab(), IsEmptyClipboard(), MSG_SCIMSG42, MSG_SCIMSG43, MSG_SCIMSG44, and PasteFunction().

00334 {
00335         LPTW lptw=GetTextWinScilab();
00336         
00337         if ( !IsEmptyClipboard(lptw) ) PasteFunction(lptw,FALSE);
00338         else 
00339         {
00340                 if (lptw->lpmw->CodeLanguage == 0)
00341                 {
00342                         MessageBox(lptw->hWndParent,MSG_SCIMSG43,MSG_SCIMSG42,MB_ICONINFORMATION);
00343                 }
00344                 else
00345                 {
00346                         MessageBox(lptw->hWndParent,MSG_SCIMSG44,MSG_SCIMSG42,MB_ICONINFORMATION);
00347                 }
00348         }
00349 }

Here is the call graph for this function:

void Callback_PAUSE ( void   ) 

Definition at line 495 of file wmenu.c.

References CTRLU, SendCTRLandAKey(), and StoreCommand1().

Referenced by SendMacro().

00496 {
00497         SendCTRLandAKey(CTRLU);
00498         StoreCommand1("pause;",1);
00499 }

Here is the call graph for this function:

Here is the caller graph for this function:

void Callback_PRINT ( void   ) 

Definition at line 356 of file wmenu.c.

References tagMW::CodeLanguage, FALSE, GetTextWinScilab(), tagTW::lpmw, MSG_SCIMSG44, MSG_SCIMSG45, PrintSelectionGUI(), SelectAll(), TextCopyClip(), and UnSelect().

Referenced by SendMacro().

00357 {
00358         LPTW lptw=GetTextWinScilab();
00359         SelectAll(lptw,FALSE);
00360         TextCopyClip (lptw);
00361         UnSelect(lptw);
00362 
00363 
00364         if (lptw->lpmw->CodeLanguage == 0)
00365         {
00366                 PrintSelectionGUI(lptw,MSG_SCIMSG44);
00367         }
00368         else
00369         {
00370                 PrintSelectionGUI(lptw,MSG_SCIMSG45);
00371         }
00372 }

Here is the call graph for this function:

Here is the caller graph for this function:

void Callback_PRINTSETUP ( void   ) 

Definition at line 351 of file wmenu.c.

References ConfigurePrinterDialogBox().

00352 {
00353         ConfigurePrinterDialogBox();
00354 }

Here is the call graph for this function:

void Callback_RESTART ( void   ) 

Definition at line 468 of file wmenu.c.

References ClearCommandWindow(), CTRLU, GetTextWinScilab(), SendCTRLandAKey(), StoreCommand1(), TRUE, and write_scilab().

Referenced by SendMacro().

00469 {
00470         LPTW lptw=GetTextWinScilab();
00471 
00472         SendCTRLandAKey(CTRLU);
00473 
00474         ClearCommandWindow(lptw,TRUE);
00475 
00476         SendCTRLandAKey(CTRLU);
00477         StoreCommand1("abort;",1);
00478 
00479         SendCTRLandAKey(CTRLU);
00480         StoreCommand1("savehistory();",1);
00481 
00482         SendCTRLandAKey(CTRLU);
00483         StoreCommand1("resethistory();",1);
00484 
00485         SendCTRLandAKey(CTRLU);
00486         write_scilab("exec('SCI/etc/scilab.start',-1);\n");
00487 }

Here is the call graph for this function:

Here is the caller graph for this function:

void Callback_RESUME ( void   ) 

Definition at line 501 of file wmenu.c.

References CTRLU, SendCTRLandAKey(), and StoreCommand1().

Referenced by SendMacro().

00502 {
00503         SendCTRLandAKey(CTRLU);
00504         StoreCommand1("resume;",1);
00505         
00506 }

Here is the call graph for this function:

Here is the caller graph for this function:

void Callback_SAVE ( void   ) 

Definition at line 208 of file wmenu.c.

References command, CTRLU, FALSE, GetTextWinScilab(), tagTW::hWndParent, MAX_PATH, MSG_SCIMSG37, OpenSaveSCIFile(), SendCTRLandAKey(), StoreCommand1(), and TRUE.

Referenced by SendMacro().

00209 {
00210         char Fichier[MAX_PATH];
00211         char command[MAX_PATH];
00212         
00213         LPTW lptw=GetTextWinScilab();
00214                                 
00215         if (OpenSaveSCIFile(lptw->hWndParent,"Save",FALSE,"Files *.sav\0*.sav\0Files *.bin\0*.bin\0All *.*\0*.*\0",Fichier) == TRUE)
00216         {
00217                 SendCTRLandAKey(CTRLU);
00218                 wsprintf(command,MSG_SCIMSG37,Fichier);
00219                 StoreCommand1 (command,1);
00220         }
00221 }

Here is the call graph for this function:

Here is the caller graph for this function:

void Callback_SCIPAD ( void   ) 

Definition at line 513 of file wmenu.c.

References CTRLU, FALSE, IsToThePrompt(), PutLineInBuffer, StoreCommand(), and StoreCommand1().

Referenced by SendMacro().

00514 {
00515         char Command[512];
00516         extern BOOL PutLineInBuffer;
00517         wsprintf(Command,"%cscipad();",CTRLU);
00518 
00519     PutLineInBuffer=FALSE;
00520         if (IsToThePrompt ()) StoreCommand1(Command,1);
00521         else StoreCommand("scipad();");
00522         PutLineInBuffer=FALSE;
00523 }

Here is the call graph for this function:

Here is the caller graph for this function:

void Callback_SELECTALL ( void   ) 

Definition at line 614 of file wmenu.c.

References GetTextWinScilab(), SelectAll(), and TRUE.

Referenced by SendMacro().

00615 {
00616         LPTW lptw=GetTextWinScilab();
00617         SelectAll(lptw,TRUE);
00618 }

Here is the call graph for this function:

Here is the caller graph for this function:

void Callback_SYSTEMCOLOR ( void   ) 

Definition at line 439 of file wmenu.c.

References tagTW::bSysColors, GetTextWinScilab(), SetIhmSystemDefaultTextBackgroundColor(), and SetIhmSystemDefaultTextColor().

Referenced by SendMacro().

00440 {
00441         LPTW lptw=GetTextWinScilab();
00442 
00443         lptw->bSysColors=1;
00444         SetIhmSystemDefaultTextColor();
00445         SetIhmSystemDefaultTextBackgroundColor();
00446 }

Here is the call graph for this function:

Here is the caller graph for this function:

void Callback_TEXTCOLOR ( void   ) 

Definition at line 405 of file wmenu.c.

References B, tagTW::bSysColors, ChooseColorBox(), G, GetIhmTextColor(), GetTextWinScilab(), R, SetIhmTextColor(), and TRUE.

Referenced by SendMacro().

00406 {
00407         int R,G,B;
00408 
00409         R=GetRValue(GetIhmTextColor());
00410         G=GetGValue(GetIhmTextColor());
00411         B=GetBValue(GetIhmTextColor());
00412 
00413         if (ChooseColorBox(&R,&G,&B))
00414         {
00415                 LPTW lptw=GetTextWinScilab();
00416 
00417                 SetIhmTextColor(R,G,B,TRUE);
00418                 lptw->bSysColors=0;
00419         }
00420 }

Here is the call graph for this function:

Here is the caller graph for this function:

void Callback_TOOLBAR ( void   ) 

Definition at line 374 of file wmenu.c.

References FALSE, GetTextWinScilab(), tagMW::LockToolBar, tagTW::lpmw, tagMW::ShowToolBar, and ToolBarOnOff().

Referenced by SendMacro().

00375 {
00376         LPTW lptw=GetTextWinScilab();
00377         
00378         if (lptw->lpmw->LockToolBar == FALSE)
00379                 {
00380                         lptw->lpmw->ShowToolBar=!lptw->lpmw->ShowToolBar;
00381                         ToolBarOnOff(lptw);
00382                 }
00383 }

Here is the call graph for this function:

Here is the caller graph for this function:

void Callback_WEB ( void   ) 

Definition at line 545 of file wmenu.c.

References error, int, MSG_WARNING22, MSG_WARNING24, NULL, SW_SHOWNORMAL, and URL.

Referenced by SendMacro().

00546 {
00547         int error =(int)ShellExecute(NULL, "open", URL, NULL, NULL, SW_SHOWNORMAL);
00548         if (error<= 32) MessageBox(NULL,MSG_WARNING24,MSG_WARNING22,MB_ICONWARNING);
00549 }

Here is the caller graph for this function:

void CloseMacros ( LPTW  lptw  ) 

Definition at line 1559 of file wmenu.c.

References i, tagTW::lpmw, tagMW::macro, and NUMMENU.

01560 {
01561   int i;
01562   HGLOBAL hglobal;
01563   LPMW lpmw;
01564   lpmw = lptw->lpmw;
01565   
01566   
01567   if (lpmw->macro != (BYTE **) NULL)
01568     {
01569       hglobal = GlobalHandle (lpmw->macro);
01570       if (hglobal)
01571         {
01572           for (i = 0; i < NUMMENU; i++)
01573             if (lpmw->macro[i] != (BYTE *) 0)
01574               {
01575                 LocalFree (lpmw->macro[i]);
01576                 lpmw->macro[i] = (BYTE *) 0;
01577               }
01578           GlobalUnlock (hglobal);
01579           GlobalFree (hglobal);
01580           lpmw->macro = (BYTE **) NULL;
01581         }
01582     }
01583   if (lpmw->szPrompt != (char *) NULL)
01584     {
01585       LocalFree (lpmw->szPrompt);
01586       lpmw->szPrompt = (char *) NULL;
01587     }
01588   if (lpmw->szAnswer != (char *) NULL)
01589     {
01590       LocalFree (lpmw->szAnswer);
01591       lpmw->szAnswer = (char *) NULL;
01592     }
01593 }

void ConfigureScilabStar ( int  LangCode  ) 

Definition at line 1900 of file wmenu.c.

References ConvertPathUnixToWindowsFormat(), getSCIpath(), MAX_PATH, ModifyFile(), and SCILABSTAR.

Referenced by SetLanguageMenu().

01901 {
01902         #define SCILABSTAR              "scilab.start"
01903 
01904         char scilabstarfullpath[MAX_PATH];
01905         char scilabstartmpfullpath[MAX_PATH];
01906         char *WSCIPath=NULL;
01907         char wscitmp[MAX_PATH+1];
01908         
01909         int CodeRetour=-2;
01910 
01911         WSCIPath=getSCIpath();
01912         ConvertPathUnixToWindowsFormat(WSCIPath,wscitmp);
01913         
01914         if (WSCIPath)
01915         {
01916                 strcpy(scilabstarfullpath,wscitmp);
01917                 strcat(scilabstarfullpath,"\\etc\\");
01918                 strcat(scilabstarfullpath,SCILABSTAR);
01919 
01920                 strcpy(scilabstartmpfullpath,scilabstarfullpath);
01921                 strcat(scilabstartmpfullpath,".tmp");
01922 
01923                 switch (LangCode)
01924                 {
01925                         case 1:
01926                                 CodeRetour=ModifyFile(scilabstarfullpath,"LANGUAGE=","LANGUAGE=\"fr\"\n");
01927                         break;
01928 
01929                         default : case 0:
01930                                 CodeRetour=ModifyFile(scilabstarfullpath,"LANGUAGE=","LANGUAGE=\"eng\"\n");
01931                         break;
01932                 }
01933 
01934                 if (CodeRetour == 0 )
01935                 {
01936                         DeleteFile(scilabstarfullpath);
01937                         if ( ! MoveFile(scilabstartmpfullpath,scilabstarfullpath) ) DeleteFile(scilabstartmpfullpath);
01938                 }
01939                 else
01940                 {
01941                 //      MessageBox(NULL,"Couldn't Modify Scilab.start","Error",MB_ICONWARNING);
01942                 }
01943         }
01944 }

Here is the call graph for this function:

Here is the caller graph for this function:

void CreateButton ( LPTW  lptw,
char *  ButtonText[BUTTONMAX],
int  index,
int  ButtonSizeX,
int  ButtonSizeY 
)

Definition at line 1331 of file wmenu.c.

References CreateMyTooltip(), FALSE, GetXPosButton(), tagMW::hButton, hdllInstance, tagTW::hInstance, tagTW::hWndParent, i, IDI_CHDIR, IDI_CONSOLE, IDI_COPY, IDI_EXIT24, IDI_FONTS, IDI_HELP, IDI_METANET24, IDI_NEWFILE, IDI_OPEN, IDI_PASTE, IDI_PRINT, IDI_SCICOS24, IDI_SCILAB24, IsAFile(), tagMW::IsAIcon, tagMW::lpfnButtonProc, tagMW::lpfnMenuButtonProc, tagTW::lpmw, MAX_PATH, MSG_ERROR47, MSG_ERROR48, Token, and TRUE.

Referenced by LoadMacros().

01332 {
01333         LPMW lpmw;
01334         lpmw = lptw->lpmw;
01335         
01336         if (strcmp(ButtonText[index],"--")==0)
01337         {
01338                 lpmw->IsAIcon[index]=TRUE;
01339                 GetXPosButton(lptw,index, 24,ButtonSizeY);
01340                 
01341         }
01342         else
01343         if ( ButtonText[index][0]=='|')
01344         {
01345                 char LineTmp[MAX_PATH];
01346                 char NameButton[MAX_PATH];
01347                 char PathIconButton[MAX_PATH];
01348                 char *Token=NULL;
01349                 HICON IconButton;
01350                 
01351                 int i=0;
01352         
01353                 
01354                 
01355                 strcpy(LineTmp,ButtonText[index]);
01356         
01357                 Token=strtok(LineTmp,"|");
01358                 strcpy(NameButton,Token);
01359                 
01360                 Token=strtok(NULL,"|");
01361                 strcpy(PathIconButton,Token);
01362                 
01363                 if ( ( IsAFile(PathIconButton)==TRUE)                ||
01364                      ( strcmp(PathIconButton,"METANET_ICON")==0)     ||
01365                      ( strcmp(PathIconButton,"SCICOS_ICON")==0)      ||
01366                      ( strcmp(PathIconButton,"PRINT_ICON")==0)       ||
01367                      ( strcmp(PathIconButton,"CONSOLE_ICON")==0)     ||
01368                      ( strcmp(PathIconButton,"DIRECTORY_ICON")==0)   ||
01369                      ( strcmp(PathIconButton,"EXIT_ICON")==0)        ||
01370                      ( strcmp(PathIconButton,"FONT_ICON")==0)        ||
01371                      ( strcmp(PathIconButton,"HELP_ICON")==0)        ||
01372                                          ( strcmp(PathIconButton,"NEW_ICON")==0)         ||
01373                                          ( strcmp(PathIconButton,"COPY_ICON")==0)        ||
01374                                          ( strcmp(PathIconButton,"PASTE_ICON")==0)       ||
01375                                          ( strcmp(PathIconButton,"OPEN_ICON")==0)       ||
01376                      ( strcmp(PathIconButton,"SCILAB_ICON")==0)  )
01377                 {
01378                         
01379                         if ( IsAFile(PathIconButton) == TRUE )
01380                         {
01381                           IconButton=(HICON)LoadImage(  GetModuleHandle(NULL), PathIconButton,IMAGE_ICON,24,24, LR_DEFAULTCOLOR|LR_LOADFROMFILE);
01382                         }
01383                         else                      
01384                         if ( strcmp(PathIconButton,"SCICOS_ICON")==0 )
01385                         {
01386                                                         IconButton=(HICON)LoadImage( hdllInstance, (LPCSTR)IDI_SCICOS24,IMAGE_ICON,24,24, LR_DEFAULTCOLOR);
01387                           
01388                         }
01389                         else
01390                         if ( strcmp(PathIconButton,"METANET_ICON")==0 )
01391                         {
01392                                                   IconButton=(HICON)LoadImage( hdllInstance, (LPCSTR)IDI_METANET24,IMAGE_ICON,24,24, LR_DEFAULTCOLOR);
01393                           
01394                         }
01395                         if ( strcmp(PathIconButton,"PRINT_ICON")==0 )
01396                         {
01397                                                         IconButton=(HICON)LoadImage( hdllInstance, (LPCSTR)IDI_PRINT,IMAGE_ICON,24,24, LR_DEFAULTCOLOR);
01398                         }
01399                         else
01400                         if ( strcmp(PathIconButton,"CONSOLE_ICON")==0 )
01401                         {
01402                                                         IconButton=(HICON)LoadImage( hdllInstance, (LPCSTR)IDI_CONSOLE,IMAGE_ICON,24,24, LR_DEFAULTCOLOR);
01403                         }
01404                         else
01405                         if ( strcmp(PathIconButton,"DIRECTORY_ICON")==0 )
01406                         {
01407                                                         IconButton=(HICON)LoadImage( hdllInstance, (LPCSTR)IDI_CHDIR,IMAGE_ICON,24,24, LR_DEFAULTCOLOR);
01408                         }
01409                         else
01410                         if ( strcmp(PathIconButton,"EXIT_ICON")==0 )
01411                         {
01412                                                         IconButton=(HICON)LoadImage( hdllInstance, (LPCSTR)IDI_EXIT24,IMAGE_ICON,24,24, LR_DEFAULTCOLOR);
01413                         }
01414                         else
01415                         if ( strcmp(PathIconButton,"FONT_ICON")==0 )
01416                         {
01417                                                         IconButton=(HICON)LoadImage( hdllInstance, (LPCSTR)IDI_FONTS,IMAGE_ICON,24,24, LR_DEFAULTCOLOR);
01418                         }
01419                         else
01420                         if ( strcmp(PathIconButton,"HELP_ICON")==0 )
01421                         {
01422                                                         IconButton=(HICON)LoadImage( hdllInstance, (LPCSTR)IDI_HELP,IMAGE_ICON,24,24, LR_DEFAULTCOLOR);
01423                         }
01424                         else
01425                         if ( strcmp(PathIconButton,"SCILAB_ICON")==0 )
01426                         {
01427                                                         IconButton=(HICON)LoadImage( hdllInstance, (LPCSTR)IDI_SCILAB24,IMAGE_ICON,24,24, LR_DEFAULTCOLOR);
01428                         }
01429                                                 else
01430                                                 if ( strcmp(PathIconButton,"NEW_ICON")==0 )
01431                         {
01432                                                         IconButton=(HICON)LoadImage( hdllInstance, (LPCSTR)IDI_NEWFILE,IMAGE_ICON,24,24, LR_DEFAULTCOLOR);
01433                         }
01434                                                 else
01435                                                 if ( strcmp(PathIconButton,"COPY_ICON")==0 )
01436                         {
01437                                                         IconButton=(HICON)LoadImage( hdllInstance, (LPCSTR)IDI_COPY,IMAGE_ICON,24,24, LR_DEFAULTCOLOR);
01438                         }
01439                                                 else
01440                                                 if ( strcmp(PathIconButton,"PASTE_ICON")==0 )
01441                         {
01442                                                         IconButton=(HICON)LoadImage( hdllInstance, (LPCSTR)IDI_PASTE,IMAGE_ICON,24,24, LR_DEFAULTCOLOR);
01443                         }
01444                                                 else
01445                                                 if ( strcmp(PathIconButton,"OPEN_ICON")==0 )
01446                         {
01447                                                         IconButton=(HICON)LoadImage( hdllInstance, (LPCSTR)IDI_OPEN,IMAGE_ICON,24,24, LR_DEFAULTCOLOR);
01448                         }
01449 
01450                                                 lpmw->IsAIcon[index]=TRUE;
01451                         lpmw->hButton[index] = CreateWindow("button",NameButton,WS_CHILD|WS_VISIBLE|BS_ICON ,
01452                                        GetXPosButton(lptw,index, 24,ButtonSizeY), 0,
01453                                        24, ButtonSizeY,
01454                                        lptw->hWndParent, (HMENU) index,
01455                                        lptw->hInstance, lptw);
01456 
01457                         /* Associe une infobulle */
01458                         CreateMyTooltip (lpmw->hButton[index], NameButton);     
01459                
01460                 
01461                         lpmw->lpfnButtonProc[index] = (WNDPROC) GetWindowLong (lpmw->hButton[index], GWL_WNDPROC);
01462                         SetWindowLong(lpmw->hButton[index], GWL_WNDPROC, (LONG) lpmw->lpfnMenuButtonProc);
01463         
01464                         /*Associe icone */
01465                         SendMessage(lpmw->hButton[index],BM_SETIMAGE, IMAGE_ICON, (LPARAM)IconButton);
01466                         
01467                 }
01468                 else
01469                 {
01470                         char MsgErr[MAX_PATH];
01471                         wsprintf(MsgErr,MSG_ERROR47,ButtonText[index]);
01472                         MessageBox(NULL,MsgErr,MSG_ERROR48,MB_ICONEXCLAMATION);
01473                         exit(1);
01474                 }     
01475         
01476 
01477         
01478         }
01479         else
01480         {
01481              lpmw->IsAIcon[index]=FALSE;                                
01482              lpmw->hButton[index] = CreateWindow ("button",ButtonText[index],WS_CHILD|WS_VISIBLE,
01483                                                   GetXPosButton(lptw,index,ButtonSizeX,ButtonSizeY), 0,
01484                                                   ButtonSizeX, ButtonSizeY,
01485                                                   lptw->hWndParent, (HMENU) index,
01486                                                   lptw->hInstance, lptw);
01487            /* Associe une infobulle */
01488              CreateMyTooltip (lpmw->hButton[index], ButtonText[index]);    
01489              lpmw->lpfnButtonProc[index] = (WNDPROC) GetWindowLong (lpmw->hButton[index], GWL_WNDPROC);
01490              SetWindowLong (lpmw->hButton[index], GWL_WNDPROC, (LONG) lpmw->lpfnMenuButtonProc);
01491              
01492         }
01493 }      

Here is the call graph for this function:

Here is the caller graph for this function:

void CreateMyTooltip ( HWND  hwnd,
char  ToolTipString[30] 
)

Definition at line 144 of file Toolbar.c.

References LPTSTR, and NULL.

Referenced by CreateButton(), and CreateButtonToolBar().

00145 {
00146         INITCOMMONCONTROLSEX iccex; 
00147         HWND hwndTT;                 // handle to the ToolTip control
00148 
00149         TOOLINFO ti; // struct specifying info about tool in ToolTip control
00150         unsigned int uid = 0;       // for ti initialization
00151 
00152         LPTSTR lptstr = ToolTipString;
00153         RECT rect;                  // for client area coordinates
00154 
00155         /* INITIALIZE COMMON CONTROLS */
00156         iccex.dwICC = ICC_WIN95_CLASSES;
00157         iccex.dwSize = sizeof(INITCOMMONCONTROLSEX);
00158         InitCommonControlsEx(&iccex);
00159 
00160         /* CREATE A TOOLTIP WINDOW */
00161         hwndTT = CreateWindowEx(WS_EX_TOPMOST,
00162                 TOOLTIPS_CLASS,
00163                 NULL,
00164                 WS_POPUP | TTS_NOPREFIX | TTS_ALWAYSTIP,                
00165                 CW_USEDEFAULT,
00166                 CW_USEDEFAULT,
00167                 CW_USEDEFAULT,
00168                 CW_USEDEFAULT,
00169                 hwnd,
00170                 NULL,
00171                 NULL,
00172                 NULL
00173                 );
00174 
00175         SetWindowPos(hwndTT,
00176                 HWND_TOPMOST,
00177                 0,
00178                 0,
00179                 0,
00180                 0,
00181                 SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);
00182 
00183         /* GET COORDINATES OF THE MAIN CLIENT AREA */
00184         GetClientRect (hwnd, &rect);
00185 
00186         /* INITIALIZE MEMBERS OF THE TOOLINFO STRUCTURE */
00187         ti.cbSize = sizeof(TOOLINFO);
00188         ti.uFlags = TTF_SUBCLASS;
00189         ti.hwnd = hwnd;
00190         ti.hinst = NULL;
00191         ti.uId = uid;
00192         ti.lpszText = lptstr;
00193         // ToolTip control will cover the whole window
00194         ti.rect.left = rect.left;    
00195         ti.rect.top = rect.top;
00196         ti.rect.right = rect.right;
00197         ti.rect.bottom = rect.bottom;
00198 
00199         /* SEND AN ADDTOOL MESSAGE TO THE TOOLTIP CONTROL WINDOW */
00200         SendMessage(hwndTT, TTM_ADDTOOL, 0, (LPARAM) (LPTOOLINFO) &ti); 
00201 
00202 } 

Here is the caller graph for this function:

void CutLineForDisplay ( char *  CutLine,
char *  Line,
int  NumberOfCharByLine 
)

Definition at line 459 of file TextToPrint.c.

References FREE, i, LenLine, MALLOC, MAX_PATH, and NULL.

Referenced by Callback_CHDIR().

00460 {
00461         int LenLine=lstrlen(Line);
00462 
00463         if (LenLine > NumberOfCharByLine)
00464         {
00465                 int NumberOfLines=lstrlen(Line)/NumberOfCharByLine;
00466                 int i=0;
00467                 char *Buffer=NULL;
00468 
00469                 Buffer=(char*)MALLOC((LenLine+NumberOfLines+1)*sizeof(char));
00470                 for (i=0;i<NumberOfLines+1;i++)
00471                 {
00472                         if ( i == 0)
00473                         {
00474                                 lstrcpyn(Buffer,&Line[i*NumberOfCharByLine],NumberOfCharByLine);
00475 
00476                         }
00477                         else
00478                         {
00479                                 char BufferCat[MAX_PATH];
00480                                 lstrcpyn(BufferCat,&Line[i*NumberOfCharByLine],NumberOfCharByLine);
00481                                 lstrcat(Buffer,BufferCat);
00482 
00483                         }
00484                         if (i != NumberOfLines) lstrcat(Buffer,"\n");
00485                 }
00486                 lstrcpy(CutLine,Buffer);
00487 
00488                 FREE(Buffer);
00489         }
00490         else
00491         {
00492                 wsprintf(CutLine,"%s",Line);
00493         }
00494 }

Here is the caller graph for this function:

int GetLanguageCodeInScilabDotStar ( void   ) 

Definition at line 2020 of file wmenu.c.

02021 {
02022         int ReturnLanguageCode=-1;
02023         char *WSCIPath=NULL;
02024 
02025         WSCIPath=getSCIpath();
02026 
02027         if (WSCIPath)
02028         {
02029                 #define SCILABSTAR              "scilab.start"
02030                 #define MOTCLEF                 "LANGUAGE="""
02031 
02032                 FILE *fileR=NULL;
02033                 char wscitmp[MAX_PATH+1];
02034                 char Ligne[MAX_PATH];
02035                 char scilabstarfullpath[MAX_PATH];
02036                 char cmpchaine[MAX_PATH];
02037 
02038                 ConvertPathUnixToWindowsFormat(WSCIPath,wscitmp);
02039 
02040                 strcpy(scilabstarfullpath,wscitmp);
02041                 strcat(scilabstarfullpath,"\\etc\\");
02042                 strcat(scilabstarfullpath,SCILABSTAR);
02043 
02044                 fileR= fopen(scilabstarfullpath, "rt");
02045                 if (fileR)
02046                 {
02047                         while( fgets(Ligne, MAX_PATH, fileR) != NULL)
02048                         {
02049                                 strncpy(cmpchaine,Ligne,strlen(MOTCLEF));
02050                                 cmpchaine[strlen(MOTCLEF)]='\0';
02051                                 if (strcmp(cmpchaine,MOTCLEF)==0)
02052                                 {
02053                                         int i=0,j=0;
02054                                         char LanguageTemp[MAX_PATH];
02055 
02056                                         strcpy(LanguageTemp,"\0");
02057                                         
02058                                         for (i=(int)strlen(MOTCLEF)+1;i<(int)strlen(Ligne)-2;i++)
02059                                         {
02060                                                 LanguageTemp[j]=Ligne[i];
02061                                                 j++;
02062                                         }
02063                                         LanguageTemp[j]='\0';
02064 
02065                                         if (strcmp(LanguageTemp,"fr")==0) ReturnLanguageCode=1;
02066                                         if (strcmp(LanguageTemp,"eng")==0) ReturnLanguageCode=0;
02067 
02068                                         fclose(fileR);
02069                                         if (WSCIPath) {FREE(WSCIPath);WSCIPath=NULL;}
02070                                         return ReturnLanguageCode;
02071                                 }
02072                                 
02073                                 strcpy(Ligne,"\0");
02074                         }
02075                 }
02076                 fclose(fileR);
02077         }
02078         if (WSCIPath) {FREE(WSCIPath);WSCIPath=NULL;}
02079         return ReturnLanguageCode;
02080 }

int GetLine ( char *  buffer,
int  len,
GFILE gfile 
)

Definition at line 1031 of file wmenu.c.

References Gfgets().

01032 {
01033   BOOL status;
01034   int nLine = 0;
01035 
01036   status = (Gfgets (buffer, len, gfile) != 0);
01037   nLine++;
01038   while (status && (buffer[0] == '\0' || buffer[0] == '\n' || buffer[0] == ';'))
01039     {
01040       /* blank line or comment - ignore */
01041       status = (Gfgets (buffer, len, gfile) != 0);
01042       nLine++;
01043     }
01044   if (lstrlen (buffer) > 0)
01045     buffer[lstrlen (buffer) - 1] = '\0';        /* remove trailing \n */
01046   if (!status)
01047     nLine = 0;                  /* zero lines if file error */
01048   return nLine;
01049 }

Here is the call graph for this function:

int GetXPosButton ( LPTW  lptw,
int  index,
int  SizeXButtonText,
int  SizeXButtonIcon 
)

Definition at line 1497 of file wmenu.c.

References tagMW::IsAIcon, tagTW::lpmw, tagMW::PositionX, and TRUE.

Referenced by CreateButton().

01498 {
01499         LPMW lpmw;
01500         int PosXButton=0;
01501         lpmw = lptw->lpmw;
01502         
01503         if (index==0) lpmw->PositionX[index]=0;
01504         else
01505                 {
01506                  if (lpmw->IsAIcon[index-1]==TRUE)
01507                  {
01508                         lpmw->PositionX[index]=lpmw->PositionX[index-1]+24;
01509                  }
01510                  else
01511                  {
01512                                 lpmw->PositionX[index]=lpmw->PositionX[index-1]+80;
01513                  }
01514                 }
01515         return lpmw->PositionX[index];
01516 }

Here is the caller graph for this function:

void Gfclose ( GFILE gfile  ) 

Definition at line 990 of file wmenu.c.

References tagGFILE::hfile.

00991 {
00992   _lclose (gfile->hfile);
00993   LocalFree (gfile);
00994   return;
00995 }

int Gfgets ( LPSTR  lp,
int  size,
GFILE gfile 
)

Definition at line 998 of file wmenu.c.

References GBUFSIZE, tagGFILE::getbuf, tagGFILE::getleft, tagGFILE::getnext, tagGFILE::hfile, and i.

00999 {
01000   int i;
01001   int ch;
01002   for (i = 0; i < size; i++)
01003     {
01004       if (gfile->getleft <= 0)
01005         {
01006           if ((gfile->getleft
01007                = _lread (gfile->hfile, gfile->getbuf, GBUFSIZE)) == 0)
01008             break;
01009           gfile->getnext = 0;
01010         }
01011       ch = *lp++ = gfile->getbuf[gfile->getnext++];
01012       gfile->getleft--;
01013       if (ch == '\r')
01014         {
01015           i--;
01016           lp--;
01017         }
01018       if (ch == '\n')
01019         {
01020           i++;
01021           break;
01022         }
01023     }
01024   if (i < size)
01025     *lp++ = '\0';
01026   return i;
01027 }

GFILE* Gfopen ( LPSTR  lpszFileName,
int  fnOpenMode 
)

Definition at line 973 of file wmenu.c.

References tagGFILE::getleft, tagGFILE::getnext, tagGFILE::hfile, and NULL.

00974 {
00975   GFILE *gfile;
00976   gfile = (GFILE *) LocalAlloc (LPTR, sizeof (GFILE));
00977   if (!gfile)
00978     return NULL;
00979   gfile->hfile = _lopen (lpszFileName, fnOpenMode);
00980   if (gfile->hfile == HFILE_ERROR)
00981     {
00982       LocalFree (gfile);
00983       return NULL;
00984     }
00985   gfile->getleft = 0;
00986   gfile->getnext = 0;
00987   return gfile;
00988 }

void HideToolBar ( LPTW  lptw  ) 

Definition at line 111 of file Toolbar.c.

References tagMW::hButton, tagTW::hWndParent, tagTW::hWndText, i, tagTW::lpmw, tagMW::nButton, NULL, and TRUE.

Referenced by HideToolBarWin32(), and ToolBarOnOff().

00112 {
00113         int i=0;                        
00114         LPMW lpmw;                      
00115         RECT rect;
00116         lpmw = lptw->lpmw;
00117 
00118         GetClientRect (lptw->hWndParent, &rect);
00119         SetWindowPos (lptw->hWndText, (HWND) NULL,0,0,
00120                 rect.right, rect.bottom,SWP_NOZORDER | SWP_NOACTIVATE);
00121         for (i = 0; i < lpmw->nButton; i++)
00122         {
00123                 ShowWindow( lpmw->hButton[i] , SW_HIDE );
00124         }
00125         InvalidateRect(lptw->hWndParent, (LPRECT) NULL, TRUE);
00126         InvalidateRect(lptw->hWndText, (LPRECT) NULL, TRUE);
00127         UpdateWindow (lptw->hWndText);
00128 
00129 }

Here is the caller graph for this function:

int HideToolBarWin32 ( int  WinNum  ) 

Definition at line 204 of file Toolbar.c.

References FALSE, GetTextWinScilab(), getWindowXgcNumber(), HideGraphToolBar(), HideToolBar(), IsWindowInterface(), tagMW::LockToolBar, tagTW::lpmw, MSG_WARNING29, NULL, sciprint(), tagMW::ShowToolBar, and TRUE.

Referenced by C2F().

00205 {
00206         if (WinNum == -1)
00207         {
00208                 if (IsWindowInterface())
00209                 {
00210                         LPTW lptw=GetTextWinScilab();
00211 
00212                         HideToolBar(lptw);
00213                         lptw->lpmw->ShowToolBar=FALSE;
00214                         lptw->lpmw->LockToolBar=TRUE;
00215                 }
00216                 else
00217                 {
00218                         sciprint(MSG_WARNING29 );
00219                 }
00220         }
00221         else
00222         {
00223                 struct BCG *ScilabGC=NULL;
00224                 ScilabGC = getWindowXgcNumber (WinNum);
00225                 if (ScilabGC != (struct BCG *) 0)
00226                 {
00227                         HideGraphToolBar(ScilabGC);
00228                         ScilabGC->lpmw.LockToolBar=TRUE;
00229                 }
00230         }
00231 
00232         return 0;
00233 }

Here is the call graph for this function:

Here is the caller graph for this function:

EXPORT BOOL CALLBACK InputBoxDlgProc ( HWND  ,
UINT  ,
WPARAM  ,
LPARAM   
)

Definition at line 1598 of file wmenu.c.

References FALSE, ID_ANSWER, ID_PROMPT, tagTW::lpmw, MAXSTR, tagMW::nChar, tagMW::szAnswer, tagMW::szPrompt, and TRUE.

01599 {
01600   LPTW lptw;
01601   LPMW lpmw;
01602   lptw = (LPTW) GetWindowLong (GetParent (hDlg), 0);
01603   lpmw = lptw->lpmw;
01604 
01605   switch (message)
01606     {
01607     case WM_INITDIALOG:
01608       SetDlgItemText (hDlg, ID_PROMPT, lpmw->szPrompt);
01609       return (TRUE);
01610 
01611     case WM_COMMAND:
01612       switch (LOWORD (wParam))
01613         {
01614         case ID_ANSWER:
01615           return (TRUE);
01616 
01617         case IDOK:
01618           lpmw->nChar = GetDlgItemText (hDlg, ID_ANSWER, lpmw->szAnswer, MAXSTR);
01619           EndDialog (hDlg, TRUE);
01620           return (TRUE);
01621 
01622         case IDCANCEL:
01623           lpmw->szAnswer[0] = '\0';
01624           EndDialog (hDlg, FALSE);
01625           return (TRUE);
01626 
01627         default:
01628           return (FALSE);
01629         }
01630     default:
01631       return (FALSE);
01632     }
01633 }

void LeftJustify ( char *  d,
char *  s 
)

Definition at line 1052 of file wmenu.c.

01053 {
01054   while (*s && (*s == ' ' || *s == '\t'))
01055     s++;                        /* skip over space */
01056   do
01057     {
01058       *d++ = *s;
01059     }
01060   while (*s++);
01061 }

void LoadMacros ( LPTW  lptw  ) 

Definition at line 1083 of file wmenu.c.

References buf, BUGGOTOCLEAN, tagTW::ButtonHeight, BUTTONMAX, cleanup(), CreateButton(), GetLine(), Gfopen(), tagMW::hButtonID, hdc, tagMW::hMenu, tagTW::hWndParent, tagTW::hWndText, i, LeftJustify(), tagMW::lpfnMenuButtonProc, tagTW::lpmw, tagMW::macro, MAXSTR, MenuButtonProc(), MENUDEPTH, MF_SEPARATOR, MSG_ERROR40, MSG_ERROR43, MSG_ERROR44, MSG_ERROR45, MSG_ERROR46, MyGetProcAddress, tagMW::nButton, tagMW::nCountMenu, NULL, NUMMENU, tagMW::szAnswer, tagMW::szMenuName, tagMW::szPrompt, TEXTMETRIC, tagTW::Title, TranslateMacro(), TryToGetDC(), UINT, and WGFindMenuPos().

01084 {
01085   GFILE *menufile;
01086   BYTE *macroptr;
01087   char *buf;
01088   int nMenuLevel;
01089   HMENU hMenu[MENUDEPTH + 1+1];
01090   LPMW lpmw;
01091   int nLine = 1;
01092   int nInc;
01093   int nCountMenu;
01094   HGLOBAL hmacro;
01095   int i;
01096   HDC hdc;
01097   TEXTMETRIC tm;
01098   RECT rect;
01099   int ButtonX, ButtonY;
01100   char *ButtonText[BUTTONMAX];
01101 
01102   lpmw = lptw->lpmw;
01103 
01104   /* mark all buffers and menu file as unused */
01105   buf = (char *) NULL;
01106   hmacro = 0;
01107   lpmw->macro = (BYTE **) NULL;
01108   lpmw->szPrompt = (char *) NULL;
01109   lpmw->szAnswer = (char *) NULL;
01110   menufile = (GFILE *) NULL;
01111 
01112   /* open menu file */
01113   if ((menufile = Gfopen (lpmw->szMenuName, OF_READ)) == (GFILE *) NULL)
01114     goto errorcleanup;
01115 
01116   /* allocate buffers */
01117   if ((buf = LocalAlloc (LPTR, MAXSTR)) == (char *) NULL)
01118     goto nomemory;
01119   hmacro = GlobalAlloc (GHND, (NUMMENU) * sizeof (BYTE *));
01120   if ((lpmw->macro = (BYTE **) GlobalLock (hmacro)) == (BYTE **) NULL)
01121     goto nomemory;
01122   if ((lpmw->szPrompt = LocalAlloc (LPTR, MAXSTR)) == (char *) NULL)
01123     goto nomemory;
01124   if ((lpmw->szAnswer = LocalAlloc (LPTR, MAXSTR)) == (char *) NULL)
01125     goto nomemory;
01126 
01127   /* Initialize macro array * */
01128   for (i = 0; i < NUMMENU; i++)
01129     {
01130       lpmw->macro[i] = (BYTE *) 0;
01131     }
01132   lpmw->nCountMenu = 0;         /* counts predefined menus * */
01133   lpmw->nButton = 0;
01134   lpmw->hMenu = hMenu[0] = CreateMenu ();
01135   nMenuLevel = 0;
01136 
01137   while ((nInc = GetLine (buf, MAXSTR, menufile)) != 0)
01138     {
01139       nLine += nInc;
01140       LeftJustify (buf, buf);
01141       if (buf[0] == '\0')
01142         {
01143           /* ignore blank lines */
01144         }
01145       else if (!lstrcmpi (buf, "[Menu]"))
01146         {
01147           /* new menu */
01148           if (!(nInc = GetLine (buf, MAXSTR, menufile)))
01149             {
01150               nLine += nInc;
01151               BUGGOTOCLEAN ("Problem on line %d of %s\n");
01152             }
01153           LeftJustify (buf, buf);
01154           if (nMenuLevel < MENUDEPTH+1)
01155             nMenuLevel++;
01156           else
01157             {
01158               BUGGOTOCLEAN (MSG_ERROR43);
01159             }
01160           hMenu[nMenuLevel] = CreateMenu ();
01161           AppendMenu (hMenu[nMenuLevel > 0 ? nMenuLevel - 1 : 0],
01162                       MF_STRING | MF_POPUP, (UINT) hMenu[nMenuLevel],
01163                       (LPCSTR) buf);
01164         }
01165       else if (!lstrcmpi (buf, "[EndMenu]"))
01166         {
01167           if (nMenuLevel > 0)
01168             nMenuLevel--;       /* back up one menu */
01169         }
01170       else if (!lstrcmpi (buf, "[Button]"))
01171         {
01172           /* button macro */
01173           if (lpmw->nButton >= BUTTONMAX)
01174             {
01175               BUGGOTOCLEAN (MSG_ERROR44);
01176             }
01177           if (!(nInc = GetLine (buf, MAXSTR, menufile)))
01178             {
01179               nLine += nInc;
01180               BUGGOTOCLEAN (MSG_ERROR45);
01181             }
01182           LeftJustify (buf, buf);
01183           if ((macroptr = LocalAlloc (LPTR, lstrlen (buf) + 1)) != (BYTE *) NULL)
01184             {
01185               lstrcpy ((char *) macroptr, buf);
01186             }
01187           else
01188             {
01189               BUGGOTOCLEAN (MSG_ERROR46);
01190             }
01191           ButtonText[lpmw->nButton] = (char *) macroptr;
01192           if (!(nInc = GetLine (buf, MAXSTR, menufile)))
01193             {
01194               nLine += nInc;
01195               BUGGOTOCLEAN (MSG_ERROR45);
01196             }
01197           LeftJustify (buf, buf);
01198           TranslateMacro (buf);
01199           if ((macroptr = LocalAlloc (LPTR, lstrlen (buf) + 1)) != (BYTE *) NULL)
01200             lstrcpy ((char *) macroptr, buf);
01201           else
01202             {
01203               BUGGOTOCLEAN (MSG_ERROR46);
01204             }
01205           nCountMenu = WGFindMenuPos (lpmw->macro);
01206           lpmw->nCountMenu++;
01207           lpmw->hButtonID[lpmw->nButton] = nCountMenu;
01208           lpmw->macro[nCountMenu] = macroptr;
01209           lpmw->nButton++;
01210         }
01211       else
01212         {
01213           nCountMenu = WGFindMenuPos (lpmw->macro);
01214           /* menu item */
01215           if (nCountMenu >= NUMMENU)
01216             {
01217               BUGGOTOCLEAN (MSG_ERROR44);
01218             }
01219           LeftJustify (buf, buf);
01220           if (buf[0] == '-')
01221             {
01222               if (nMenuLevel == 0)
01223                 AppendMenu (hMenu[0], MF_MENUBREAK, 0, (LPSTR) NULL);
01224               else
01225                 AppendMenu (hMenu[nMenuLevel], MF_SEPARATOR, 0, (LPSTR) NULL);
01226             }
01227           else if (buf[0] == '|')
01228             {
01229               AppendMenu (hMenu[nMenuLevel], MF_MENUBARBREAK, 0, (LPSTR) NULL);
01230             }
01231           else
01232             {
01233               AppendMenu (hMenu[nMenuLevel], MF_STRING, nCountMenu, (LPSTR) buf);
01234               if (!(nInc = GetLine (buf, MAXSTR, menufile)))
01235                 {
01236                   nLine += nInc;
01237                   BUGGOTOCLEAN (MSG_ERROR45);
01238                 }
01239               LeftJustify (buf, buf);
01240               TranslateMacro (buf);
01241               if ((macroptr = LocalAlloc (LPTR, lstrlen (buf) + 1)) != (BYTE *) NULL)
01242                 {
01243                   lstrcpy ((char *) macroptr, buf);
01244                 }
01245               else
01246                 {
01247                   BUGGOTOCLEAN ("Out of space for storing menu macros\n at line %d of %s\n");
01248                 }
01249               lpmw->macro[nCountMenu] = macroptr;
01250               lpmw->nCountMenu++;
01251             }
01252         }
01253     }
01254   nCountMenu = WGFindMenuPos (lpmw->macro);
01255   if ((nCountMenu - lpmw->nButton) > 0)
01256     {
01257       /* we have a menu bar so put it on the window */
01258       SetMenu (lptw->hWndParent, lpmw->hMenu);
01259       DrawMenuBar (lptw->hWndParent);
01260     }
01261 
01262   if (!lpmw->nButton)  goto cleanup;            /* no buttons */
01263     
01264 
01265 
01266   /* calculate size of buttons */
01267   hdc = (HDC)TryToGetDC (lptw->hWndParent);
01268   
01269   SelectFont (hdc, GetStockFont (SYSTEM_FIXED_FONT));
01270   GetTextMetrics (hdc, &tm);
01271   ButtonX = 10 * tm.tmAveCharWidth;
01272   //ButtonY = 6 * (tm.tmHeight + tm.tmExternalLeading) / 4;
01273   ButtonY = 24;
01274   ReleaseDC (lptw->hWndParent, hdc);
01275 
01276   /* move top of client text window down to allow space for buttons */
01277   lptw->ButtonHeight = ButtonY + 1;
01278   GetClientRect (lptw->hWndParent, &rect);
01279   SetWindowPos (lptw->hWndText, (HWND) NULL, 0, lptw->ButtonHeight,
01280                 rect.right, rect.bottom - lptw->ButtonHeight,
01281                 SWP_NOZORDER | SWP_NOACTIVATE);
01282 
01283   /* create the buttons */
01284 
01285   lpmw->lpfnMenuButtonProc = (WNDPROC) MyGetProcAddress ("MenuButtonProc", MenuButtonProc);
01286   for (i = 0; i < lpmw->nButton; i++)
01287     {
01288         CreateButton(lptw,ButtonText, i,ButtonX, ButtonY);
01289     }
01290    
01291 
01292   goto cleanup;
01293 
01294 nomemory:
01295   MessageBox (lptw->hWndParent, MSG_ERROR40, lptw->Title, MB_ICONEXCLAMATION);
01296 
01297 errorcleanup:
01298   if (hmacro)
01299     {
01300       for (i = 0; i < NUMMENU; i++)
01301         {
01302           if (lpmw->macro[i] != (BYTE *) 0)
01303             {
01304               LocalFree (lpmw->macro[i]);
01305               lpmw->macro[i] = (BYTE *) 0;
01306             }
01307         }
01308       GlobalUnlock (hmacro);
01309       GlobalFree (hmacro);
01310       lpmw->macro = (BYTE **) NULL;
01311     }
01312   if (lpmw->szPrompt != (char *) NULL)
01313     {
01314       LocalFree (lpmw->szPrompt);
01315       lpmw->szPrompt = (char *) NULL;
01316     }
01317   if (lpmw->szAnswer != (char *) NULL)
01318     {
01319       LocalFree (lpmw->szAnswer);
01320       lpmw->szAnswer = (char *) NULL;
01321     }
01322 
01323 cleanup:
01324   if (buf != (char *) NULL)
01325     LocalFree (buf);
01326   if (menufile != (GFILE *) NULL)
01327     Gfclose (menufile);
01328   return;
01329 }

Here is the call graph for this function:

EXPORT LRESULT CALLBACK MenuButtonProc ( HWND  ,
UINT  ,
WPARAM  ,
LPARAM   
)

Definition at line 1522 of file wmenu.c.

References tagMW::hButtonID, tagTW::hWndText, L, tagMW::lpfnButtonProc, tagTW::lpmw, n, pt, and SetFocus().

Referenced by LoadMacros().

01523 {
01524   LPTW lptw;
01525   LPMW lpmw;
01526   LONG n = GetWindowLong (hwnd, GWL_ID);
01527   
01528   lptw = (LPTW) GetWindowLong (GetParent (hwnd), 0);
01529   lpmw = lptw->lpmw;
01530 
01531 
01532 
01533   switch (message)
01534     {
01535         
01536     case WM_LBUTTONUP:
01537       {
01538         RECT rect;
01539         POINT pt;
01540         GetWindowRect (hwnd, &rect);
01541         GetCursorPos (&pt);
01542         if (PtInRect (&rect, pt)) SendMessage (lptw->hWndText, WM_COMMAND, lpmw->hButtonID[n], 0L);
01543         SetFocus (lptw->hWndText);
01544       }
01545       break;
01546      
01547      break;
01548       
01549     }
01550   return CallWindowProc ((lpmw->lpfnButtonProc[n]), hwnd, message, wParam, lParam);
01551 }

Here is the call graph for this function:

Here is the caller graph for this function:

void MenuFixCurrentWin ( int  ivalue  ) 

Definition at line 929 of file wmenu.c.

References C2F, chmenu(), firstentry, gwin_name, gwin_name1, i, lab_count, ONE, top, xscion(), and XtNlabel.

00930 {
00931   static int firstentry = 0, top = -1;
00932   int i;
00933   if (firstentry == 0)
00934     {
00935       strcpy (gwin_name, "&Graphic Window 0");
00936       firstentry++;
00937     }
00938   if (lab_count != ivalue)
00939     {
00940       C2F (xscion) (&i);
00941       if (i == 1)
00942         {
00943           lab_count = ivalue;
00944           strcpy (gwin_name1, gwin_name);
00945           sprintf (gwin_name, "&Graphic Window %d", (int) ivalue);
00946           C2F (chmenu) (&top, gwin_name1, gwin_name);
00947         }
00948     }
00949 }

Here is the call graph for this function:

int ModifyFile ( char *  fichier,
char *  motclef,
char *  chaine 
)

Definition at line 1946 of file wmenu.c.

References MAX_PATH.

Referenced by ConfigureScilabStar().

01947 {
01948                 int Retour=1;
01949                 FILE *fileR,*fileW;
01950                 char Ligne[MAX_PATH];
01951                 char cmpchaine[MAX_PATH];
01952                 
01953                 fileR=NULL;
01954                 fileW=NULL;
01955 
01956                 fileR= fopen(fichier, "rt");
01957                 strcpy(cmpchaine,fichier);
01958                 strcat(cmpchaine,".tmp");
01959 
01960                 fileW= fopen(cmpchaine, "wt");
01961                 strcpy(cmpchaine,"");
01962 
01963                 if ( (fileR) && (fileW) )
01964                 {
01965                         while( fgets(Ligne, MAX_PATH, fileR) != NULL)
01966                         { 
01967                                 strncpy(cmpchaine,Ligne,strlen(motclef));
01968                                 cmpchaine[strlen(motclef)]='\0';
01969                                 if (strcmp(cmpchaine,motclef)==0)
01970                                 {
01971                                         fputs(chaine,fileW);
01972                                         Retour=0;
01973                                 }
01974                                 else
01975                                 {
01976                                         fputs(Ligne,fileW);
01977                                 }
01978                         strcpy(Ligne,"\0");
01979                 }
01980                         
01981                 fclose(fileR);
01982                         fclose(fileW);
01983                 }
01984                 else
01985                 {
01986                         Retour=-1;
01987                 }
01988                 return Retour;
01989 }

Here is the caller graph for this function:

BOOL OpenSaveSCIFile ( HWND  hWndParent,
char *  titre,
BOOL  read,
char *  FileExt,
char *  file 
)

Definition at line 1636 of file wmenu.c.

References FALSE, MAX_PATH, and TRUE.

Referenced by Callback_EXEC(), Callback_GETF(), Callback_LOAD(), Callback_OPEN(), and Callback_SAVE().

01637 {
01638         BOOL Retour=FALSE;
01639         char szBuffer[MAX_PATH] = "";
01640         OPENFILENAME OFN;
01641                 
01642         ZeroMemory(&OFN, sizeof(OFN));
01643   OFN.lStructSize = sizeof(OFN);
01644   
01645   OFN.hwndOwner = hWndParent;
01646   OFN.hInstance = NULL;
01647   OFN.lpstrFilter = FileExt;
01648   OFN.nFilterIndex=1;
01649   OFN.lpstrFile = NULL;/*FILE NAME*/
01650   OFN.nMaxFile = 0;/*SIZE OF FILE NAME*/
01651   OFN.lpstrFile = szBuffer;
01652   OFN.nMaxFile = MAX_PATH;
01653   OFN.lpstrTitle = titre;
01654  
01655   if (read == TRUE)
01656         {
01657                 /* Lecture */
01658                 OFN.Flags = OFN_PATHMUSTEXIST | OFN_FILEMUSTEXIST | OFN_NOCHANGEDIR;
01659           if( GetOpenFileName( &OFN ) )
01660         {
01661                         lstrcpy(file,OFN.lpstrFile);
01662         Retour=TRUE;
01663                 }
01664                 else Retour=FALSE;
01665         }
01666         else
01667         {
01668                 /* Ecriture */
01669                 OFN.Flags = OFN_PATHMUSTEXIST | OFN_FILEMUSTEXIST | OFN_NOCHANGEDIR|OFN_HIDEREADONLY;
01670           if(GetSaveFileName ( &OFN ) )
01671     {
01672                         lstrcpy(file,OFN.lpstrFile);
01673                         Retour=TRUE;
01674                 }
01675                 else Retour=FALSE;
01676         }
01677         
01678         return Retour;
01679 }

Here is the caller graph for this function:

void ReLoadMenus ( LPTW  lptw  ) 

Definition at line 1818 of file wmenu.c.

01819 {
01820         int i=0;                        
01821         LPMW lpmw;                      
01822 
01823         lpmw = lptw->lpmw;
01824         
01825         /* Destruction des menus */
01826         CloseMacros (lptw);
01827         /* Destruction des boutons ToolBar*/
01828         for (i = 0; i < lpmw->nButton; i++)
01829         {
01830                 DestroyWindow(lpmw->hButton[i]);
01831         }
01832         /* Contruction Menu et Toolbar */
01833         UpdateFileNameMenu(lptw);
01834         LoadMacros (lptw);
01835         /* Affichage Toolbar */
01836         ToolBarOnOff(lptw);
01837 }

void ReplaceSlash ( char *  pathout,
char *  pathin 
)

Definition at line 1682 of file wmenu.c.

01683 {
01684         int i=0;
01685         for (i=0;i < (int)strlen(pathin);i++)
01686                 {
01687 
01688                         if (pathin[i]=='\\')
01689                         {
01690                                 pathout[i]='/';
01691                         }
01692                         else
01693                         {
01694                                 pathout[i]=pathin[i];
01695                         }
01696 
01697                 }
01698         pathout[i]='\0';
01699 }

void ResetMenu ( void   ) 

Definition at line 1894 of file wmenu.c.

01895 {
01896         LPTW lptw=GetTextWinScilab();
01897         ReLoadMenus(lptw);
01898 }   

BOOL SciOpenSave ( HWND  hWndParent,
BYTE **  s,
BOOL  save,
char **  d,
int ierr 
)

Definition at line 1709 of file wmenu.c.

References FREE, i, MAXSTR, and NEWSTRING.

01710 {
01711   int i, nChar;
01712   OPENFILENAME ofn;
01713   char *szTitle;
01714   char *szFile;
01715   char *szFileTitle;
01716   char *szFilter;
01717   BOOL flag;
01718 
01719   NEWSTRING (szTitle);
01720   NEWSTRING (szFile);
01721   NEWSTRING (szFileTitle);
01722   NEWSTRING (szFilter);
01723 
01724   (*s)++;
01725   for (i = 0; (**s >= 32 && **s <= 126); i++)
01726   {
01727     szTitle[i] = **s;
01728    (*s)++;
01729   }                             /* get dialog box title */
01730   szTitle[i] = '\0';
01731   (*s)++;
01732   for (i = 0; (**s >= 32 && **s <= 126); i++)
01733   {
01734     szFile[i] = **s;
01735     (*s)++;
01736   }                             /* temporary copy of filter */
01737   szFile[i++] = '\0';
01738   lstrcpy (szFilter, "Default (");
01739   lstrcat (szFilter, szFile);
01740   lstrcat (szFilter, ")");
01741   i = lstrlen (szFilter);
01742   i++;                          /* move past NULL */
01743   lstrcpy (szFilter + i, szFile);
01744   i += lstrlen (szFilter + i);
01745   i++;                          /* move past NULL */
01746   lstrcpy (szFilter + i, "All Files (*.*)");
01747   i += lstrlen (szFilter + i);
01748   i++;                          /* move past NULL */
01749   lstrcpy (szFilter + i, "*.*");
01750   i += lstrlen (szFilter + i);
01751   i++;                          /* move past NULL */
01752   szFilter[i++] = '\0';         /* add a second NULL */
01753   /* the Windows 3.1 implentation - MC */
01754   szFile[0] = '\0';
01755 
01756   /* clear the structrure */
01757         ZeroMemory(&ofn, sizeof(ofn));
01758   ofn.lStructSize = sizeof (ofn);
01759   ofn.hwndOwner = hWndParent;
01760   ofn.lpstrFilter = szFilter;
01761   ofn.nFilterIndex = 1;
01762   ofn.lpstrFile = szFile;
01763   ofn.nMaxFile = MAXSTR;
01764   ofn.lpstrFileTitle = szFileTitle;
01765   ofn.nMaxFileTitle = MAXSTR;
01766   ofn.lpstrTitle = szTitle;
01767   ofn.lpstrInitialDir = (LPSTR) NULL;
01768 
01769         if (save)
01770         {
01771                 ofn.Flags = OFN_PATHMUSTEXIST;
01772                 flag=GetSaveFileName (&ofn);
01773         }
01774         else
01775         {
01776                 ofn.Flags = OFN_PATHMUSTEXIST | OFN_FILEMUSTEXIST;
01777                 flag=GetOpenFileName (&ofn);
01778         }
01779 
01780         if (flag)
01781         {
01782                 nChar = lstrlen (ofn.lpstrFile);
01783                 for (i = 0; i < nChar; i++)
01784                 {
01785                         **d = ofn.lpstrFile[i];
01786                         (*d)++;
01787                 }
01788         }
01789   
01790   FREE (szTitle);
01791   FREE (szFilter);
01792   FREE (szFile);
01793   FREE (szFileTitle);
01794 
01795   return (flag);
01796 }

void SendCTRLandAKey ( int  code  ) 

Definition at line 1799 of file wmenu.c.

01800 {
01801         extern TW textwin;
01802         char command[MAX_PATH];
01803         char *d;
01804         
01805         wsprintf(command,"%c",(char)code);
01806         if ( IsToThePrompt ()  && (command[0] != '\0') )
01807         {
01808                 d = command;
01809                 while (*d)
01810                         {
01811                                 SendMessage (textwin.hWndText, WM_CHAR, *d, 1L);
01812                                 d++;
01813                         }
01814         }
01815 }

void SendMacro ( LPTW  lptw,
UINT  m 
)

Definition at line 637 of file wmenu.c.

00638 {
00639 
00640   BYTE *s;
00641   char *d;
00642   char *buf;
00643   BOOL flag = TRUE;
00644  
00645   LPMW lpmw = lptw->lpmw;
00646 
00647   if ((buf = LocalAlloc (LPTR, MAXSTR + 1)) == (char *) NULL) return;
00648 
00649   if (m >= NUMMENU || (int)m < 0) return;
00650 
00651   s = lpmw->macro[m];
00652   d = buf;
00653   *d = '\0';
00654   while (s && *s && (d - buf < MAXSTR))
00655     {
00656       if (*s >= CMDMIN && *s <= CMDMAX)
00657         {
00658           /* int ierr = 0; */
00660           switch (*s)
00661             {
00662                 case NEWSCILAB:
00663                         Callback_NEWSCILAB();
00664                         return;
00665                 break;
00666                         case OPEN:
00667                                 SaveCurrentLine(TRUE);
00668                                 Callback_OPEN();
00669                                 return;
00670                 case EXEC:
00671                                 Callback_EXEC();
00672                         return;
00673                         break;
00674                 case GETF:
00675                         Callback_GETF();
00676                         return;
00677                 break;
00678                 case LOAD:
00679                         Callback_LOAD();
00680                         return;
00681                 break;  
00682                 case SAVE:
00683                         Callback_SAVE();
00684                         return;
00685                 break;
00686                 case CHDIR:
00687                         Callback_CHDIR();
00688                         return;
00689                 break;
00690                 case GETCWD:
00691                         Callback_GETCWD();
00692                         return;
00693                 break;
00694                 case EXIT:
00695                         ExitWindow();
00696                         return;
00697                 break;
00698                         case SELECTALL:
00699                                 Callback_SELECTALL();
00700                                 return;
00701                         break;
00702                 case MCOPY:
00703                         Callback_MCOPY();
00704                         s++;
00705                 break;
00706                 case PASTE:
00707                         Callback_PASTE();
00708                         return;
00709                 break; 
00710                 case EMPTYCLIPBOARD:
00711                                 Callback_EMPTYCLIPBOARD();
00712                                 return;
00713                         break;
00714                         case PRINTSETUP:
00715                                 Callback_PRINTSETUP();
00716                                 return;
00717                                 break;
00718                 case PRINT:
00719                         Callback_PRINT();
00720                         return;
00721                 break;
00722                 case TOOLBAR:
00723                         Callback_TOOLBAR();
00724                         return;
00725                 break;
00726                 case FRENCH:
00727                         Callback_FRENCH();
00728                         return;
00729                 break;
00730                 case ENGLISH:
00731                         Callback_ENGLISH();
00732                         return;
00733                 break;
00734                         case TEXTCOLOR:
00735                                 Callback_TEXTCOLOR();
00736                                 return;
00737                         case BACKGROUNDCOLOR:
00738                                 Callback_BACKGROUNDCOLOR();
00739                                 return;
00740                         case SYSTEMCOLOR:
00741                                 Callback_SYSTEMCOLOR();
00742                                 return;
00743                         case FILESASSOCIATION:
00744                                 Callback_FILESASSOCIATIONBOX();
00745                                 return;
00746                 case CHOOSETHEFONT:
00747                         Callback_CHOOSETHEFONT();
00748                         s++;
00749                 break;
00750                 case RESTART:
00751                         Callback_RESTART();
00752                         return;
00753                 break;
00754                 case ABORT:
00755                         Callback_ABORT();
00756                         return;
00757                 break;
00758                 case PAUSE:
00759                         Callback_PAUSE();
00760                         return;
00761                 break;
00762                 case RESUME:
00763                         Callback_RESUME();                      
00764                         return;
00765                 break;
00766                 case CONSOLE:
00767                         Callback_CONSOLE();
00768                         return;
00769                 break;
00770                 case SCIPAD:
00771                                 SaveCurrentLine(TRUE);
00772                         Callback_SCIPAD();
00773                         return;
00774                 break;
00775                 case HELP:
00776                                 SaveCurrentLine(TRUE);
00777                                 Callback_HELP();
00778                         return;
00779                 break;
00780                         case CONFIGBROWSER:
00781                                 SaveCurrentLine(TRUE);
00782                                 Callback_CONFIGUREBROWSER();
00783                                 return;
00784                         break;
00785                         case CLEARHISTORY:
00786                                 Callback_CLEARHISTORY();
00787                                 return;
00788                         break;
00789                 case DEMOS:
00790                         Callback_DEMOS();
00791                         return;
00792                 break;
00793                 case WEB:
00794                         Callback_WEB();
00795                         return;
00796                 break;
00797                         case CONTRIBUTIONS:
00798                         Callback_CONTRIBUTIONS();
00799                         return;
00800                 break;
00801                 case BUGZILLA:
00802                         Callback_BUGZILLA();
00803                         return;
00804                 break;
00805                 case EMAIL:
00806                         Callback_EMAIL();
00807                         return;
00808                 break;
00809                 case NEWSGROUP:
00810                         Callback_NEWSGROUP();
00811                         return;
00812                 break;
00813                 case ABOUT:
00814                         Callback_ABOUT();
00815                         return;
00816                 break;
00817                 case M_CTRL_C:
00818                 {
00819                         SignalCtrC ();
00820                         write_scilab("\n");
00821                 }
00822                         return;
00823                 break;
00824                 
00825                 case M_CTRL_U:
00826                 {
00827                          SendCTRLandAKey(CTRLU);
00828                 }
00829                         return;
00830                 break;
00831                 
00832                 case M_CTRL_P:
00833                 {
00834                          SendCTRLandAKey(CTRLP);
00835                 }
00836                         return;
00837                 break;
00838                 case M_CTRL_B:
00839                 {
00840                          SendCTRLandAKey(CTRLB);
00841                 }
00842                         return;
00843                 break;  
00844                 case M_CTRL_F:
00845                 {
00846                          SendCTRLandAKey(CTRLF);
00847                 }
00848                         return;
00849                 break;  
00850                 case M_CTRL_A:
00851                 {
00852                          SendCTRLandAKey(CTRLA);
00853                 }
00854                         return;
00855                 break;  
00856                 case M_CTRL_E:
00857                 {
00858                          SendCTRLandAKey(CTRLE);
00859                 }
00860                         return;
00861                 break;  
00862                 case M_CTRL_H:
00863                 {
00864                          SendCTRLandAKey(CTRLH);
00865                 }
00866                         return;
00867                 break;  
00868                 case M_CTRL_D:
00869                 {
00870                          SendCTRLandAKey(CTRLD);
00871                 }
00872                         return;
00873                 break;  
00874                 case M_CTRL_W:
00875                 {
00876                          SendCTRLandAKey(CTRLW);
00877                 }
00878                         return;
00879                 break;  
00880                 case M_CTRL_K:
00881                 {
00882                          SendCTRLandAKey(CTRLK);
00883                 }
00884                         return;
00885                 break;  
00886                 case M_CTRL_L:
00887                 {
00888                          SendCTRLandAKey(CTRLL);
00889                 }
00890                 return;
00891                 break;  
00892                 case CLEARCOMMANDWINDOW:
00893                 {
00894                         Callback_CLEARCOMMANDWINDOW();
00895                 }
00896                 return;
00897                 break;  
00898                 
00899                 return;
00900                 break;  
00901                 case EOS:               /* [EOS] - End Of String - do nothing */
00902                 default:
00903                         s++;
00904                 break;
00905         
00906             
00907             }
00908           if (!flag)
00909             {                   /* abort */
00910               d = buf;
00911               s = (BYTE *) "";
00912             }
00913         }
00914       else
00915         {
00916           *d++ = *s++;
00917         }
00918     }
00919   *d = '\0';
00921   ScilabMenuAction (buf);
00922   LocalFree (buf);
00923 }

void SetLanguageMenu ( char *  Language  ) 

Definition at line 1992 of file wmenu.c.

References tagMW::CodeLanguage, ConfigureScilabStar(), CTRLU, GetTextWinScilab(), IsWindowInterface(), tagTW::lpmw, SendCTRLandAKey(), StoreCommand1(), and SwitchLanguage().

Referenced by C2F().

01993 {
01994         if (IsWindowInterface())
01995         {
01996                 int LanguageCode=0;
01997                 char *LanguageInScilabDotStar=NULL;
01998                 LPTW lptw=GetTextWinScilab();
01999 
02000                 if (strcmp(Language,"fr") == 0) LanguageCode=1;
02001                 if (strcmp(Language,"en") == 0) LanguageCode=0;
02002 
02003                 if (lptw->lpmw->CodeLanguage != LanguageCode)
02004                 {
02005                         SendCTRLandAKey(CTRLU);
02006                         lptw->lpmw->CodeLanguage=LanguageCode;
02007                         SwitchLanguage(lptw);
02008                         ConfigureScilabStar(lptw->lpmw->CodeLanguage);
02009                         StoreCommand1 ("exec(SCI+'/contrib/loader.sce');",0);
02010                 }
02011 
02012         }
02013         else
02014         {
02015                 // sciprint("Not in Console mode\n");
02016                 // No Message
02017         }
02018 }

Here is the call graph for this function:

Here is the caller graph for this function:

void ShowToolBar ( LPTW  lptw  ) 

Definition at line 90 of file Toolbar.c.

References tagTW::ButtonHeight, tagMW::hButton, tagTW::hWndParent, tagTW::hWndText, i, tagTW::lpmw, tagMW::nButton, NULL, SW_SHOWNORMAL, and TRUE.

Referenced by ToolBarOnOff().

00091 {
00092         int i=0;                        
00093         LPMW lpmw;                      
00094         RECT rect;
00095 
00096         lpmw = lptw->lpmw;
00097 
00098         GetClientRect (lptw->hWndParent, &rect);
00099         SetWindowPos (lptw->hWndText, (HWND) NULL, 0, lptw->ButtonHeight,
00100                 rect.right, rect.bottom - lptw->ButtonHeight,SWP_NOZORDER | SWP_NOACTIVATE);    
00101         for (i = 0; i < lpmw->nButton; i++)
00102         {
00103                 ShowWindow( lpmw->hButton[i] , SW_SHOWNORMAL );
00104         }
00105 
00106         InvalidateRect(lptw->hWndParent, (LPRECT) NULL, TRUE);
00107         InvalidateRect(lptw->hWndText, (LPRECT) NULL, TRUE);
00108         UpdateWindow (lptw->hWndText);
00109 }

Here is the caller graph for this function:

void SwitchLanguage ( LPTW  lptw  ) 

Definition at line 1866 of file wmenu.c.

References tagMW::CodeLanguage, tagTW::lpmw, OnRightClickMenu(), ReLoadMenus(), StoreCommand1(), and ToolBarOnOff().

Referenced by SetLanguageMenu().

01867 {
01868         char commandline[256];
01869 
01870         strcpy(commandline,"global LANGUAGE;%helps=initial_help_chapters(LANGUAGE);");
01871 
01872         StoreCommand1 (commandline, 0);
01873         switch (lptw->lpmw->CodeLanguage)
01874         {
01875                 case 1:
01876                         StoreCommand1 ("LANGUAGE=\"fr\";", 0);
01877                 break;
01878                 
01879                 default: case 0:
01880                         StoreCommand1 ("LANGUAGE=\"eng\";", 0);
01881                 break;
01882         }
01883         StoreCommand1 (commandline, 0);
01884 
01885         strcpy(commandline,"global LANGUAGE;%helps=initial_help_chapters(LANGUAGE);");
01886         StoreCommand1 (commandline, 0);
01887     
01888         ReLoadMenus(lptw);
01889         ToolBarOnOff(lptw);
01890         OnRightClickMenu(lptw);
01891 
01892 }

Here is the call graph for this function:

Here is the caller graph for this function:

void ToolBarOnOff ( LPTW  lptw  ) 

Definition at line 131 of file Toolbar.c.

00132 {
00133         BOOL ON=lptw->lpmw->ShowToolBar;
00134         if  (ON)
00135         {
00136                 ShowToolBar(lptw);
00137         }
00138         else
00139         {
00140                 HideToolBar(lptw);
00141         }
00142 }

void TranslateMacro ( char *  string  ) 

Definition at line 1064 of file wmenu.c.

References i, keyeq, keyword, len, and NULL.

01065 {
01066   int i, len;
01067   LPSTR ptr;
01068   for (i = 0; keyword[i] != (char *) NULL; i++)
01069     {
01070       if ((ptr = strstr (string, keyword[i])) != NULL)
01071         {
01072           len = lstrlen (keyword[i]);
01073           *ptr = keyeq[i];
01074           lstrcpy (ptr + 1, ptr + len);
01075           i--;                  /* allows for more than one occurrence of keyword */
01076         }
01077     }
01078 }

void UpdateFileNameMenu ( LPTW  lptw  ) 

Definition at line 1839 of file wmenu.c.

References tagMW::CodeLanguage, FALSE, FILEMENUENGLISH, FILEMENUFRENCH, FREE, GetScilabDirectory(), tagTW::lpmw, MALLOC, and tagMW::szMenuName.

Referenced by ReLoadMenus().

01840 {
01841         #define FILEMENUFRENCH "wscilabF.mnu"
01842         #define FILEMENUENGLISH "wscilabE.mnu"
01843 
01844         char *ScilabDirectory=NULL;
01845         
01846         LPMW lpmw= lptw->lpmw;
01847         
01848         ScilabDirectory=GetScilabDirectory(FALSE);
01849 
01850         if (lpmw->szMenuName!=NULL) FREE(lpmw->szMenuName);
01851     lpmw->szMenuName = (LPSTR) MALLOC (strlen (ScilabDirectory) +strlen("\\bin\\") +strlen (FILEMENUENGLISH) + 1);
01852         
01853         switch (lpmw->CodeLanguage)
01854         {
01855                 case 1:
01856                         wsprintf(lpmw->szMenuName,"%s\\bin\\%s",ScilabDirectory, FILEMENUFRENCH);
01857                 break;
01858                 default : case 0:
01859                         wsprintf(lpmw->szMenuName,"%s\\bin\\%s",ScilabDirectory,FILEMENUENGLISH);
01860                 break;
01861         }
01862 
01863         if (ScilabDirectory){FREE(ScilabDirectory);ScilabDirectory=NULL;}               
01864 }

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

BYTE keyeq[] [static]

Initial value:

Definition at line 136 of file WMENU.H.

char* keyword[] [static]

Initial value:

{
  "[EMPTYCLIPBOARD]","[SELECTALL]","[CLEARHISTORY]","[CONFIGBROWSER]","[OPEN]","[FRENCH]","[ENGLISH]",
  "[TOOLBAR]","[NEWSGROUP]","[CLEARCOMMANDWINDOW]","[NEWSCILAB]","[EXEC]","[GETF]","[LOAD]","[SAVE]","[CHDIR]","[GETCWD]","[EXIT]",
  "[MCOPY]","[PASTE]","[PRINTSETUP]","[PRINT]","[CHOOSETHEFONT]","[TEXTCOLOR]","[BACKGROUNDCOLOR]","[SYSTEMCOLOR]","[FILESASSOCIATION]",
  "[RESTART]","[PAUSE]","[RESUME]","[ABORT]","[CONSOLE]",
  "[SCIPAD]",
  "[HELP]","[DEMOS]","[WEB]","[EMAIL]","[CONTRIBUTIONS]","[BUGZILLA]","[ABOUT]",
  "{ENTER}", "{ESC}", "{TAB}",
  "[M_CTRL_A]", "[M_CTRL_B]", "[M_CTRL_C]", "[M_CTRL_D]", "[M_CTRL_E]", "[M_CTRL_F]", "{^G}", "[M_CTRL_H]",
  "{^I}", "{^J}", "[M_CTRL_K]", "[M_CTRL_L]", "{^M}", "[M_CTRL_N]", "{^O}", "[M_CTRL_P]",
  "{^Q}", "{^R}", "{^S}", "{^T}", "[M_CTRL_U]", "{^V}", "[M_CTRL_W]", "{^X}",
  "{^Y}", "{^Z}", "{^[}", "{^\\}", "{^]}", "{^^}", "{^_}",
  NULL}

Definition at line 121 of file WMENU.H.


Generated on Sun Mar 4 15:59:39 2007 for Scilab [trunk] by  doxygen 1.5.1