#include "WndConsoleTextProc.h"Include dependency graph for WndConsoleTextProc.c:

Go to the source code of this file.
Defines | |
| #define | VK_V 86 |
| #define | VK_C 67 |
| #define | WM_MOUSEWHEEL 0x020A |
Functions | |
| BOOL | HasAZoneTextSelected (LPTW lptw) |
| void | TextCopyClip (LPTW lptw) |
| int | StoreCommand1 (char *command, int flag) |
| void | ClearCommandWindow (LPTW lptw, BOOL Clearfirstline) |
| void | ToolBarOnOff (LPTW lptw) |
| void | ResetMenu (void) |
| void | SwitchConsole (void) |
| BOOL | IsEmptyClipboard (LPTW lptw) |
| void | PasteFunction (LPTW lptw, BOOL special) |
| void | ClearMark (LPTW lptw, POINT pt) |
| void | UpdateMark (LPTW lptw, POINT pt) |
| void | LimitMark (LPTW lptw, POINT FAR *lppt) |
| void | CreateThreadPaste (char *Text) |
| void | SendMacro (LPTW lptw, UINT m) |
| void | TextSelectFont (LPTW lptw) |
| void | WriteRegistryTxt (LPTW lptw) |
| void | SaveCurrentLine (BOOL RewriteLineAtPrompt) |
| void | HelpOn (LPTW lptw) |
| void | PrintSelectionGUI (LPTW lptw, char *Entete) |
| void | OpenSelection (LPTW lptw) |
| void | CutSelection (LPTW lptw) |
| void | EvaluateSelection (LPTW lptw) |
| void | SelectAll (LPTW lptw, BOOL DoAMark) |
| void | InitIhmDefaultColor (void) |
| BOOL | SetIhmSystemDefaultTextBackgroundColor (void) |
| HDC | TryToGetDC (HWND hWnd) |
| void | TextMakeFont (LPTW lptw) |
| void | DoLine (LPTW lptw, HDC hdc, int xpos, int ypos, int offset, int count) |
| void | ResizeScreenBuffer (LPTW lptw) |
| BOOL | SetIhmSystemDefaultTextColor (void) |
| LPTW | GetTextWinScilab (void) |
| BOOL | ActivateTransparencyMode (HWND hWnd) |
| void | IncreaseAlphaLevel (void) |
| void | DecreaseAlphaLevel (void) |
| int C2F() | scilines (int *nl, int *nc) |
| void | ExitWindow (void) |
| BOOL | IsEnableTransparencyMode (void) |
| BOOL | ON_WND_TEXT_WM_CLOSE (HWND hwnd) |
| BOOL | ON_WND_TEXT_WM_DESTROY (HWND hwnd) |
| BOOL | ON_WND_TEXT_WM_CREATE (HWND hwnd, LPCREATESTRUCT lpCreateStruct) |
| BOOL | ON_WND_TEXT_WM_PAINT (HWND hwnd) |
| BOOL | ON_WND_TEXT_WM_SYSCOLORCHANGE (HWND hwnd) |
| BOOL | ON_WND_TEXT_WM_COMMAND (HWND hwnd, int id, HWND hwndCtl, UINT codeNotify) |
| void | ON_WND_TEXT_WM_CHAR (HWND hwnd, TCHAR ch, int cRepeat) |
| void | ON_WND_TEXT_WM_SETTEXT (HWND hwnd, LPCTSTR lpszText) |
| void | ON_WND_TEXT_WM_MOUSEMOVE (HWND hwnd, int x, int y, UINT keyFlags) |
| void | ON_WND_TEXT_WM_LBUTTONUP (HWND hwnd, int x, int y, UINT keyFlags) |
| void | ON_WND_TEXT_WM_LBUTTONDOWN (HWND hwnd, BOOL fDoubleClick, int x, int y, UINT keyFlags) |
| void | ON_WND_TEXT_WM_MBUTTONUP (HWND hwnd, int x, int y, UINT keyFlags) |
| void | ON_WND_TEXT_WM_RBUTTONDOWN (HWND hwnd, BOOL fDoubleClick, int x, int y, UINT keyFlags) |
| void | ON_WND_TEXT_WM_KEY (HWND hwnd, UINT vk, BOOL fDown, int cRepeat, UINT flags) |
| void | ON_WND_TEXT_WM_VSCROLL (HWND hwnd, HWND hwndCtl, UINT code, int pos) |
| void | ON_WND_TEXT_WM_HSCROLL (HWND hwnd, HWND hwndCtl, UINT code, int pos) |
| void | ON_WND_TEXT_WM_MOUSEWHEEL (HWND hwnd, int xPos, int yPos, int zDelta, UINT fwKeys) |
| void | ON_WND_TEXT_WM_SIZE (HWND hwnd, UINT state, int cx, int cy) |
| void | ON_WND_TEXT_WM_KILLFOCUS (HWND hwnd, HWND hwndNewFocus) |
| void | ON_WND_TEXT_WM_SETFOCUS (HWND hwnd, HWND hwndOldFocus) |
| BOOL | ON_WND_TEXT_WM_SETCURSOR (HWND hwnd, HWND hwndCursor, UINT codeHitTest, UINT msg) |
| EXPORT LRESULT CALLBACK | WndTextProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) |
| #define VK_C 67 |
Definition at line 9 of file WndConsoleTextProc.c.
| #define VK_V 86 |
| #define WM_MOUSEWHEEL 0x020A |
| BOOL ActivateTransparencyMode | ( | HWND | hWnd | ) |
Definition at line 29 of file Transparency.c.
References FALSE, TransparencyON, and TRUE.
Referenced by ON_WND_TEXT_WM_KEY().
00030 { 00031 BOOL bOK=FALSE; 00032 TransparencyON=TRUE; 00033 bOK=TRUE; 00034 00035 return bOK; 00036 }
Here is the caller graph for this function:

| void ClearCommandWindow | ( | LPTW | lptw, | |
| BOOL | Clearfirstline | |||
| ) |
Definition at line 1416 of file wtext.c.
01417 { 01418 /* Deselectionne une eventuelle zone de texte */ 01419 if ( HasAZoneTextSelected(lptw) ) 01420 { 01421 POINT pt; 01422 pt.x = 0; 01423 pt.y = 0; 01424 pt.x = (pt.x + lptw->ScrollPos.x)/lptw->CharSize.x; 01425 pt.y = (pt.y + lptw->ScrollPos.y)/lptw->CharSize.y; 01426 ClearMark(lptw, pt); 01427 lptw->Marking = FALSE; 01428 } 01429 if (Clearfirstline) SendCTRLandAKey(CTRLU); /*On efface la ligne courante */ 01430 InitScreenBuffer(lptw); 01431 01432 /* Initialisation su buffer Ecran */ 01433 _fmemset (lptw->ScreenBuffer, ' ', lptw->ScreenSize.x * lptw->ScreenSize.y); 01434 01435 /* Repositionnement de la ligne de commande */ 01436 TextGotoXY (lptw, 0, 0); 01437 /* Remise à zero des scrollbars */ 01438 lptw->ScrollPos.x=0; 01439 lptw->ScrollPos.y=0; 01440 SetScrollPos (lptw->hWndText, SB_VERT, lptw->ScrollPos.y, TRUE); 01441 SetScrollPos (lptw->hWndText, SB_HORZ, lptw->ScrollPos.x, TRUE); 01442 /* Reactualisation de la fenetre */ 01443 UpdateWindow (lptw->hWndText); 01444 InvalidateRect (lptw->hWndText, NULL, TRUE); 01445 }
| void ClearMark | ( | LPTW | lptw, | |
| POINT | pt | |||
| ) |
Definition at line 524 of file wtext.c.
Referenced by ClearCommandWindow(), ON_WND_TEXT_WM_LBUTTONDOWN(), SelectAll(), TextClearEOL(), TextClearEOS(), TextDeleteLine(), TextInsertLine(), and UnSelect().
00525 { 00526 RECT rect1, rect2, rect3; 00527 int tmp; 00528 if ((lptw->MarkBegin.x != lptw->MarkEnd.x) || 00529 (lptw->MarkBegin.y != lptw->MarkEnd.y)) 00530 { 00531 if (lptw->MarkBegin.x > lptw->MarkEnd.x) 00532 { 00533 tmp = lptw->MarkBegin.x; 00534 lptw->MarkBegin.x = lptw->MarkEnd.x; 00535 lptw->MarkEnd.x = tmp; 00536 } 00537 if (lptw->MarkBegin.y > lptw->MarkEnd.y) 00538 { 00539 tmp = lptw->MarkBegin.y; 00540 lptw->MarkBegin.y = lptw->MarkEnd.y; 00541 lptw->MarkEnd.y = tmp; 00542 } 00543 /* calculate bounding rectangle in character coordinates */ 00544 if (lptw->MarkBegin.y != lptw->MarkEnd.y) 00545 { 00546 rect1.left = 0; 00547 rect1.right = lptw->ScreenSize.x; 00548 } 00549 else 00550 { 00551 rect1.left = lptw->MarkBegin.x; 00552 rect1.right = lptw->MarkEnd.x + 1; 00553 } 00554 rect1.top = lptw->MarkBegin.y; 00555 rect1.bottom = lptw->MarkEnd.y + 1; 00556 /* now convert to client coordinates */ 00557 rect1.left = rect1.left * lptw->CharSize.x - lptw->ScrollPos.x; 00558 rect1.right = rect1.right * lptw->CharSize.x - lptw->ScrollPos.x; 00559 rect1.top = rect1.top * lptw->CharSize.y - lptw->ScrollPos.y; 00560 rect1.bottom = rect1.bottom * lptw->CharSize.y - lptw->ScrollPos.y; 00561 /* get client rect and calculate intersection */ 00562 GetClientRect (lptw->hWndText, &rect2); 00563 IntersectRect (&rect3, &rect1, &rect2); 00564 /* update window if necessary */ 00565 if (!IsRectEmpty (&rect3)) 00566 { 00567 InvalidateRect (lptw->hWndText, &rect3, TRUE); 00568 } 00569 } 00570 LimitMark (lptw, &pt); 00571 lptw->MarkBegin.x = lptw->MarkEnd.x = pt.x; 00572 lptw->MarkBegin.y = lptw->MarkEnd.y = pt.y; 00573 UpdateWindow (lptw->hWndText); 00574 }
Here is the caller graph for this function:

| void CreateThreadPaste | ( | char * | Text | ) |
Definition at line 28 of file clipboard.c.
00029 { 00030 DWORD IdThreadPaste; 00031 PasteForThread=(char*)MALLOC( (strlen(Text)+1)*sizeof(char)); 00032 strcpy(PasteForThread,Text); 00033 PasteForThread[strlen(PasteForThread)]='\0'; 00034 /* PasteForThread défini en global car passage via CreateThread plante sous Win98 */ 00035 hThreadPaste=CreateThread(NULL,0,(LPTHREAD_START_ROUTINE)SendInputText,NULL,0,(LPDWORD)&IdThreadPaste); 00036 00037 }
| void CutSelection | ( | LPTW | lptw | ) |
Definition at line 1156 of file wtext.c.
Referenced by ON_WND_TEXT_WM_COMMAND().
Here is the caller graph for this function:

| void DecreaseAlphaLevel | ( | void | ) |
Definition at line 101 of file Transparency.c.
References Alpha, FALSE, GetCurrentAlphaLevel(), GetTextWinScilab(), tagTW::hWndParent, tagTW::hWndText, and SetCurrentAlphaLevel().
Referenced by ON_WND_TEXT_WM_KEY().
00102 { 00103 BOOL bOK=FALSE; 00104 LPTW lptw=GetTextWinScilab(); 00105 int Alpha=GetCurrentAlphaLevel(); 00106 00107 if (Alpha<0) Alpha=0; 00108 else 00109 { 00110 SetCurrentAlphaLevel(lptw->hWndParent ,Alpha--); 00111 SetCurrentAlphaLevel(lptw->hWndText ,Alpha--); 00112 } 00113 return bOK; 00114 }
Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 577 of file wtext.c.
Referenced by DoMark(), and ON_WND_TEXT_WM_PAINT().
00578 { 00579 BYTE FAR *pa, attr; 00580 int idx, num; 00581 pa = lptw->AttrBuffer + offset; 00582 if ((offset < 0) || (offset >= lptw->ScreenSize.x*lptw->ScreenSize.y)) 00583 MessageBox((HWND)NULL, MSG_ERROR56, MSG_ERROR56, MB_OK | MB_ICONEXCLAMATION); 00584 idx = 0; 00585 num = count; 00586 while (num > 0) 00587 { 00588 attr = *pa; 00589 while ((num > 0) && (attr == *pa)) 00590 { 00591 /* skip over bytes with same attribute */ 00592 num--; 00593 pa++; 00594 } 00595 00596 SetTextColor(hdc, GetIhmTextColor()); 00597 SetBkColor(hdc, GetIhmTextBackgroundColor()); 00598 00599 TextOut(hdc,xpos,ypos, (LPSTR)(lptw->ScreenBuffer + offset + idx), 00600 count-num-idx); 00601 xpos += lptw->CharSize.x * (count-num-idx); 00602 idx = count-num; 00603 } 00604 }
Here is the caller graph for this function:

| void EvaluateSelection | ( | LPTW | lptw | ) |
Definition at line 1206 of file wtext.c.
Referenced by ON_WND_TEXT_WM_COMMAND().
01207 { 01208 HDC hdc; 01209 HGLOBAL hGMem; 01210 01211 TEXTMETRIC tm; 01212 UINT type; 01213 LPSTR lpMem; /* Pointeur sur la chaine du clipboard */ 01214 char *MessagePaste=NULL; 01215 01216 01217 /* Copie dans le presse papier */ 01218 /* La zone sélectionnée */ 01219 TextCopyClip (lptw); 01220 01221 /*Récupere ce qu'il y a dans le presse papier*/ 01222 01223 hdc = GetDC (lptw->hWndText); 01224 SelectFont (hdc, lptw->hfont); 01225 GetTextMetrics (hdc, (TEXTMETRIC *) & tm); 01226 if (tm.tmCharSet == OEM_CHARSET) type = CF_OEMTEXT; 01227 else type = CF_TEXT; 01228 ReleaseDC (lptw->hWndText, hdc); 01229 /* now get it from clipboard */ 01230 OpenClipboard (lptw->hWndText); 01231 hGMem = GetClipboardData (type); 01232 if (hGMem) 01233 { 01234 int i=0; 01235 int l=0; 01236 01237 lpMem= GlobalLock (hGMem); 01238 l=strlen(lpMem); 01239 MessagePaste=(char*)MALLOC(l*sizeof(char)); 01240 strcpy(MessagePaste,lpMem); 01241 GlobalUnlock (hGMem); 01242 } 01243 CloseClipboard (); 01244 strcat(MessagePaste,"\n"); 01245 write_scilab_synchro(MessagePaste); 01246 01247 }
Here is the caller graph for this function:

| void ExitWindow | ( | void | ) |
Definition at line 1736 of file wtext.c.
Referenced by ON_WND_TEXT_WM_CLOSE(), and SendMacro().
01737 { 01738 char Message[255]; 01739 char Title[50]; 01740 LPTW lptw=GetTextWinScilab(); 01741 01742 if ( (get_is_reading()==FALSE) || (GetThreadPasteRunning()) ) 01743 { 01744 if (GetThreadPasteRunning())SuspendThread(GetHandleThreadPaste()); 01745 01746 switch (lptw->lpmw->CodeLanguage) 01747 { 01748 case 1: 01749 strcpy(Message,MSG_SCIMSG83); 01750 strcpy(Title,MSG_SCIMSG84); 01751 break; 01752 case 0:default: 01753 strcpy(Message,MSG_SCIMSG85); 01754 strcpy(Title,MSG_SCIMSG86); 01755 break; 01756 } 01757 01758 if (MessageBox(lptw->hWndParent,Message,Title,MB_SYSTEMMODAL|MB_YESNO|MB_ICONWARNING)==IDYES) 01759 { 01760 /* Stop la thread Coller si en cours*/ 01761 ResumeThread(GetHandleThreadPaste()); 01762 if (GetThreadPasteRunning()) 01763 { 01764 TerminateThread(GetHandleThreadPaste(),1); 01765 SetThreadPasteRunning(FALSE); 01766 CloseHandle( GetHandleThreadPaste() ); 01767 } 01768 if (IsEnableTransparencyMode()) ScilabFxFadeOut(); 01769 WriteRegistryTxt (lptw); 01770 C2F(sciquit)(); 01771 } 01772 else 01773 { 01774 if (GetThreadPasteRunning()) ResumeThread(GetHandleThreadPaste()); 01775 } 01776 } 01777 else 01778 { 01779 if (lptw->bGetCh) 01780 { 01781 if (IsEnableTransparencyMode()) ScilabFxFadeOut(); 01782 WriteRegistryTxt (lptw); 01783 C2F(sciquit)(); 01784 } 01785 else 01786 { 01787 switch (lptw->lpmw->CodeLanguage) 01788 { 01789 case 1: 01790 strcpy(Message,MSG_SCIMSG83); 01791 strcpy(Title,MSG_SCIMSG84); 01792 break; 01793 case 0:default: 01794 strcpy(Message,MSG_SCIMSG85); 01795 strcpy(Title,MSG_SCIMSG86); 01796 break; 01797 } 01798 01799 if (MessageBox(lptw->hWndParent,Message,Title,MB_SYSTEMMODAL|MB_YESNO|MB_ICONWARNING)==IDYES) 01800 { 01801 if (IsEnableTransparencyMode()) ScilabFxFadeOut(); 01802 WriteRegistryTxt (lptw); 01803 C2F(sciquit)(); 01804 } 01805 } 01806 } 01807 }
Here is the caller graph for this function:

| LPTW GetTextWinScilab | ( | void | ) |
| BOOL HasAZoneTextSelected | ( | LPTW | lptw | ) |
Definition at line 1377 of file wtext.c.
Referenced by Callback_MCOPY(), ClearCommandWindow(), CtrlCHit(), ON_WND_TEXT_WM_KEY(), ON_WND_TEXT_WM_LBUTTONUP(), SelectAll(), TextGetCh(), and UnSelect().
01378 { 01379 BOOL ValRetour=FALSE; 01380 01381 if ( (lptw->ScreenSize.x * lptw->MarkBegin.y + lptw->MarkBegin.x) - 01382 (lptw->ScreenSize.x * lptw->MarkEnd.y + lptw->MarkEnd.x) != 0) 01383 {ValRetour=TRUE;} 01384 01385 return ValRetour; 01386 }
Here is the caller graph for this function:

| void HelpOn | ( | LPTW | lptw | ) |
Definition at line 1077 of file wtext.c.
Referenced by ON_WND_TEXT_WM_COMMAND().
01079 { 01080 HDC hdc; 01081 HGLOBAL hGMem; 01082 01083 TEXTMETRIC tm; 01084 UINT type; 01085 LPSTR lpMem; /* Pointeur sur la chaine du clipboard */ 01086 char *MessagePaste=NULL; 01087 char Command[MAX_PATH]; 01088 01089 strcpy(Command,""); 01090 01091 /* Copie dans le presse papier */ 01092 /* La zone sélectionnée */ 01093 TextCopyClip (lptw); 01094 01095 /*Récupere ce qu'il y a dans le presse papier*/ 01096 01097 hdc = GetDC (lptw->hWndText); 01098 SelectFont (hdc, lptw->hfont); 01099 GetTextMetrics (hdc, (TEXTMETRIC *) & tm); 01100 if (tm.tmCharSet == OEM_CHARSET) type = CF_OEMTEXT; 01101 else type = CF_TEXT; 01102 ReleaseDC (lptw->hWndText, hdc); 01103 /* now get it from clipboard */ 01104 OpenClipboard (lptw->hWndText); 01105 hGMem = GetClipboardData (type); 01106 if (hGMem) 01107 { 01108 int i=0; 01109 int l=0; 01110 01111 lpMem= GlobalLock (hGMem); 01112 l=strlen(lpMem); 01113 MessagePaste=(char*)MALLOC( (l+1)*sizeof(char)); 01114 strcpy(MessagePaste,lpMem); 01115 MessagePaste[l]='\0'; 01116 GlobalUnlock (hGMem); 01117 01118 /* On enleve les prompts */ 01119 /*CleanPromptFromText(MessagePaste);*/ 01120 01121 /* On enleve : et retour chariot */ 01122 l=strlen(MessagePaste); 01123 for (i=0;i<l;i++) 01124 { 01125 if (MessagePaste[i]==':') MessagePaste[i]=' '; 01126 if (MessagePaste[i]=='\n') MessagePaste[i]=' '; 01127 if (MessagePaste[i]=='\r') MessagePaste[i]=' '; 01128 } 01129 01130 } 01131 CloseClipboard (); 01132 01133 if (MessagePaste) 01134 { 01135 01136 int minlen=strlen("help \"\""); 01137 01138 if ( strlen(MessagePaste)+minlen > MAX_PATH) 01139 { 01140 char MessageTMP[MAX_PATH]; 01141 strncpy(MessageTMP,MessagePaste,MAX_PATH-minlen); 01142 wsprintf(Command,"help \"%s\"",MessageTMP); 01143 } 01144 else 01145 { 01146 wsprintf(Command,"help \"%s\"",MessagePaste); 01147 } 01148 01149 if (strcmp (Command,"help \"\"")!=0 ) StoreCommand1 (Command,0); 01150 FREE(MessagePaste); 01151 } 01152 01153 }
Here is the caller graph for this function:

| void IncreaseAlphaLevel | ( | void | ) |
Definition at line 75 of file Transparency.c.
References Alpha, DisableTransparencyMode(), FALSE, GetCurrentAlphaLevel(), GetTextWinScilab(), tagTW::hWndParent, tagTW::hWndText, NULL, SetCurrentAlphaLevel(), and TRUE.
Referenced by ON_WND_TEXT_WM_KEY().
00076 { 00077 BOOL bOK=FALSE; 00078 LPTW lptw=GetTextWinScilab(); 00079 int Alpha=GetCurrentAlphaLevel(); 00080 00081 if (Alpha==255) 00082 { 00083 DisableTransparencyMode(lptw->hWndParent); 00084 DisableTransparencyMode(lptw->hWndText); 00085 DragAcceptFiles (lptw->hWndParent, TRUE); 00086 InvalidateRect(lptw->hWndParent,NULL,TRUE); 00087 InvalidateRect(lptw->hWndText,NULL,TRUE); 00088 } 00089 else 00090 { 00091 if (Alpha<255) 00092 { 00093 SetCurrentAlphaLevel(lptw->hWndParent ,Alpha++); 00094 SetCurrentAlphaLevel(lptw->hWndText ,Alpha++); 00095 if (Alpha>255) Alpha=255; 00096 } 00097 } 00098 return bOK; 00099 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void InitIhmDefaultColor | ( | void | ) |
Definition at line 111 of file ihmcolor.c.
00112 { 00113 CurrentIHMTextColor=GetSysColor(COLOR_WINDOWTEXT); 00114 CurrentIHMTextBackgroundColor=GetSysColor(COLOR_WINDOW); 00115 }
| BOOL IsEmptyClipboard | ( | LPTW | lptw | ) |
Definition at line 167 of file clipboard.c.
References FALSE, hdc, tagTW::hfont, tagTW::hWndText, NULL, TEXTMETRIC, TRUE, TryToGetDC(), type, and UINT.
Referenced by Callback_PASTE(), and ON_WND_TEXT_WM_RBUTTONDOWN().
00169 { 00170 BOOL Retour=TRUE; 00171 HDC hdc; 00172 HGLOBAL hGMem; 00173 TEXTMETRIC tm; 00174 UINT type; 00175 LPSTR lpMem=NULL; /* Pointeur sur la chaine du clipboard */ 00176 00177 00178 /* find out what type to get from clipboard */ 00179 hdc = (HDC)TryToGetDC (lptw->hWndText); 00180 SelectObject(hdc, lptw->hfont); 00181 GetTextMetrics(hdc,(TEXTMETRIC FAR *)&tm); 00182 if (tm.tmCharSet == OEM_CHARSET) type = CF_OEMTEXT; 00183 else type = CF_TEXT; 00184 ReleaseDC (lptw->hWndText, hdc); 00185 00186 /* now get it from clipboard */ 00187 OpenClipboard (lptw->hWndText); 00188 hGMem = GetClipboardData (type); 00189 00190 if (hGMem) 00191 { 00192 lpMem = GlobalLock( hGMem ); 00193 if (lpMem==NULL) Retour=TRUE; 00194 else Retour=FALSE; 00195 GlobalUnlock (hGMem); 00196 } 00197 CloseClipboard (); 00198 00199 return Retour; 00200 }
Here is the call graph for this function:

Here is the caller graph for this function:

| BOOL IsEnableTransparencyMode | ( | void | ) |
| void LimitMark | ( | LPTW | lptw, | |
| POINT FAR * | lppt | |||
| ) |
Definition at line 506 of file wtext.c.
Referenced by ClearMark(), NewLine(), ON_WND_TEXT_WM_MOUSEMOVE(), TextScrollReverse(), and UpdateMark().
00507 { 00508 if (lppt->x < 0) 00509 lppt->x = 0; 00510 if (lppt->y < 0) 00511 { 00512 lppt->x = 0; 00513 lppt->y = 0; 00514 } 00515 if (lppt->x > lptw->ScreenSize.x) 00516 lppt->x = lptw->ScreenSize.x; 00517 if (lppt->y >= lptw->ScreenSize.y) 00518 { 00519 lppt->x = 0; 00520 lppt->y = lptw->ScreenSize.y; 00521 } 00522 }
Here is the caller graph for this function:

| void ON_WND_TEXT_WM_CHAR | ( | HWND | hwnd, | |
| TCHAR | ch, | |||
| int | cRepeat | |||
| ) |
Definition at line 353 of file WndConsoleTextProc.c.
References count, GetTextWinScilab(), tagTW::KeyBuf, tagTW::KeyBufIn, tagTW::KeyBufOut, and tagTW::KeyBufSize.
Referenced by WndTextProc().
00354 { 00355 LPTW lptw=GetTextWinScilab(); 00356 long count=0; 00357 00358 count = lptw->KeyBufIn - lptw->KeyBufOut; 00359 00360 if (count < 0) count = count+ lptw->KeyBufSize; 00361 00362 if (count < (long)lptw->KeyBufSize-2) 00363 { 00364 if (ch==10) ch=13; 00365 *lptw->KeyBufIn++ = ch; 00366 00367 if (lptw->KeyBufIn - lptw->KeyBuf >= (signed)lptw->KeyBufSize) lptw->KeyBufIn = lptw->KeyBuf; /* wrap around */ 00368 } 00369 }
Here is the call graph for this function:

Here is the caller graph for this function:

| BOOL ON_WND_TEXT_WM_CLOSE | ( | HWND | hwnd | ) |
Definition at line 114 of file WndConsoleTextProc.c.
References ExitWindow(), and TRUE.
Referenced by WndTextProc().
00115 { 00116 ExitWindow(); 00117 return TRUE; 00118 }
Here is the call graph for this function:

Here is the caller graph for this function:

| BOOL ON_WND_TEXT_WM_COMMAND | ( | HWND | hwnd, | |
| int | id, | |||
| HWND | hwndCtl, | |||
| UINT | codeNotify | |||
| ) |
Definition at line 259 of file WndConsoleTextProc.c.
References AboutBox(), CutSelection(), EvaluateSelection(), FALSE, GetTextWinScilab(), HelpOn(), M_ABOUT, M_CHOOSE_FONT, M_COPY_CLIP, M_CUT, M_EVALSELECTION, M_HELPON, M_OPENSELECTION, M_PASTE, M_PRINTSELECTION, M_SELECT_ALL, M_SPECIALPASTE, M_WRITEINI, MSG_SCIMSG44, MSG_SCIMSG45, NUMMENU, OpenSelection(), PasteFunction(), PrintSelectionGUI(), SaveCurrentLine(), SelectAll(), SendMacro(), TextCopyClip(), TextSelectFont(), TRUE, and WriteRegistryTxt().
Referenced by WndTextProc().
00260 { 00261 LPTW lptw=GetTextWinScilab(); 00262 00263 if (id < NUMMENU) SendMacro (lptw, id); 00264 else 00265 switch (id) 00266 { 00267 case M_COPY_CLIP: 00268 { 00269 TextCopyClip (lptw); 00270 } 00271 break; 00272 00273 case M_PASTE: 00274 { 00275 PasteFunction(lptw,FALSE); 00276 } 00277 break; 00278 00279 case M_SPECIALPASTE: 00280 { 00281 PasteFunction(lptw,TRUE); 00282 } 00283 break; 00284 00285 case M_CHOOSE_FONT: 00286 { 00287 TextSelectFont (lptw); 00288 } 00289 break; 00290 00291 case M_WRITEINI: 00292 { 00293 WriteRegistryTxt (lptw); 00294 } 00295 break; 00296 00297 case M_ABOUT: 00298 { 00299 AboutBox (hwnd); 00300 } 00301 break; 00302 00303 case M_HELPON: 00304 { 00305 SaveCurrentLine(TRUE); 00306 HelpOn(lptw); 00307 } 00308 break; 00309 00310 case M_PRINTSELECTION: 00311 { 00312 TextCopyClip (lptw); 00313 if (lptw->lpmw->CodeLanguage == 0) 00314 { 00315 PrintSelectionGUI(lptw,MSG_SCIMSG44); 00316 } 00317 else 00318 { 00319 PrintSelectionGUI(lptw,MSG_SCIMSG45); 00320 } 00321 } 00322 break; 00323 00324 case M_OPENSELECTION: 00325 { 00326 SaveCurrentLine(TRUE); 00327 OpenSelection(lptw); 00328 } 00329 break; 00330 00331 case M_CUT: 00332 { 00333 CutSelection(lptw); 00334 } 00335 break; 00336 00337 case M_EVALSELECTION: 00338 { 00339 EvaluateSelection(lptw); 00340 } 00341 break; 00342 00343 case M_SELECT_ALL: 00344 { 00345 SelectAll(lptw,TRUE); 00346 } 00347 break; 00348 00349 } 00350 return TRUE; 00351 }
Here is the call graph for this function:

Here is the caller graph for this function:

| BOOL ON_WND_TEXT_WM_CREATE | ( | HWND | hwnd, | |
| LPCREATESTRUCT | lpCreateStruct | |||
| ) |
Definition at line 127 of file WndConsoleTextProc.c.
References hdc, TextMakeFont(), TEXTMETRIC, TRUE, and TryToGetDC().
Referenced by WndTextProc().
00128 { 00129 TEXTMETRIC tm; 00130 HDC hdc; 00131 LPTW lptw = lpCreateStruct->lpCreateParams; 00132 00133 SetWindowLong (hwnd, 0, (LONG) lptw); 00134 lptw->hWndText = hwnd; 00135 TextMakeFont (lptw); 00136 hdc = (HDC)TryToGetDC (hwnd); 00137 SelectFont (hdc, lptw->hfont); 00138 GetTextMetrics (hdc, (LPTEXTMETRIC) & tm); 00139 lptw->CharSize.y = tm.tmHeight; 00140 lptw->CharSize.x = tm.tmAveCharWidth; 00141 lptw->CharAscent = tm.tmAscent; 00142 ReleaseDC (hwnd, hdc); 00143 00144 return TRUE; 00145 }
Here is the call graph for this function:

Here is the caller graph for this function:

| BOOL ON_WND_TEXT_WM_DESTROY | ( | HWND | hwnd | ) |
Definition at line 120 of file WndConsoleTextProc.c.
References GetTextWinScilab(), tagTW::hbrBackground, and TRUE.
Referenced by WndTextProc().
00121 { 00122 LPTW lptw=GetTextWinScilab(); 00123 DeleteObject(lptw->hbrBackground); 00124 return TRUE; 00125 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void ON_WND_TEXT_WM_HSCROLL | ( | HWND | hwnd, | |
| HWND | hwndCtl, | |||
| UINT | code, | |||
| int | pos | |||
| ) |
Definition at line 763 of file WndConsoleTextProc.c.
References tagTW::CharSize, tagTW::ClientSize, GetTextWinScilab(), max, min, NULL, SB_HORZ, tagTW::ScrollMax, tagTW::ScrollPos, and TRUE.
Referenced by WndTextProc().
00764 { 00765 int nXinc=0; 00766 LPTW lptw=GetTextWinScilab(); 00767 00768 switch (code) 00769 { 00770 case SB_ENDSCROLL: 00771 nXinc = 0; 00772 break; 00773 00774 case SB_LEFT: 00775 nXinc = 0; 00776 break; 00777 00778 case SB_RIGHT: 00779 nXinc =lptw->ClientSize.x; 00780 break; 00781 00782 case SB_LINELEFT: 00783 nXinc = -lptw->CharSize.x; 00784 break; 00785 00786 case SB_LINERIGHT: 00787 nXinc = lptw->CharSize.x; 00788 break; 00789 00790 case SB_PAGELEFT: 00791 nXinc = min(-1,-lptw->ClientSize.x); 00792 break; 00793 00794 case SB_PAGERIGHT: 00795 nXinc = max(1,lptw->ClientSize.x); 00796 break; 00797 00798 case SB_THUMBPOSITION: 00799 nXinc = pos - lptw->ScrollPos.x; 00800 break; 00801 00802 case SB_THUMBTRACK: 00803 nXinc = pos - lptw->ScrollPos.x; 00804 break; 00805 00806 default: 00807 nXinc = 0; 00808 break; 00809 } 00810 00811 if ((nXinc = max (-lptw->ScrollPos.x, min (nXinc, lptw->ScrollMax.x - lptw->ScrollPos.x))) != 0) 00812 { 00813 lptw->ScrollPos.x += nXinc; 00814 ScrollWindow (hwnd, -nXinc, 0, NULL, NULL); 00815 SetScrollPos (hwnd, SB_HORZ, lptw->ScrollPos.x, TRUE); 00816 UpdateWindow (hwnd); 00817 } 00818 00819 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void ON_WND_TEXT_WM_KEY | ( | HWND | hwnd, | |
| UINT | vk, | |||
| BOOL | fDown, | |||
| int | cRepeat, | |||
| UINT | flags | |||
| ) |
Definition at line 538 of file WndConsoleTextProc.c.
References ActivateTransparencyMode(), ClearCommandWindow(), count, DecreaseAlphaLevel(), FALSE, GetTextWinScilab(), HasAZoneTextSelected(), tagTW::hWndParent, tagTW::hWndText, IncreaseAlphaLevel(), IsEnableTransparencyMode(), tagTW::KeyBuf, tagTW::KeyBufIn, tagTW::KeyBufOut, tagTW::KeyBufSize, tagMW::LockToolBar, tagTW::lpmw, M_PASTE, ResetMenu(), tagMW::ShowToolBar, StoreCommand1(), SwitchConsole(), TextCopyClip(), ToolBarOnOff(), TRUE, and VK_V.
Referenced by WndTextProc().
00539 { 00540 if (GetKeyState (VK_SHIFT) < 0) 00541 { 00542 switch (vk) 00543 { 00544 case VK_UP: 00545 { 00546 } 00547 break; 00548 00549 case VK_DOWN: 00550 { 00551 } 00552 break; 00553 00554 case VK_LEFT: 00555 { 00556 } 00557 break; 00558 00559 case VK_RIGHT: 00560 { 00561 } 00562 break; 00563 00564 case VK_INSERT: 00565 /* Modification Allan CORNET 09/07/03 */ 00566 /* Touches Shift-Insert effectue un "coller" du presse papier */ 00567 { 00568 SendMessage (hwnd, WM_COMMAND,M_PASTE, (LPARAM) 0); 00569 } 00570 break; 00571 } 00572 } 00573 else 00574 { 00575 if (GetKeyState (VK_CONTROL) < 0) 00576 { 00577 switch (vk) 00578 { 00579 case VK_HOME: 00580 SendMessage (hwnd, WM_VSCROLL, SB_TOP, (LPARAM) 0); 00581 break; 00582 case VK_END: 00583 SendMessage (hwnd, WM_VSCROLL, SB_BOTTOM, (LPARAM) 0); 00584 break; 00585 case VK_PRIOR: 00586 SendMessage (hwnd, WM_VSCROLL, SB_PAGEUP, (LPARAM) 0); 00587 break; 00588 case VK_NEXT: 00589 SendMessage (hwnd, WM_VSCROLL, SB_PAGEDOWN, (LPARAM) 0); 00590 break; 00591 case VK_UP: 00592 SendMessage (hwnd, WM_VSCROLL, SB_LINEUP, (LPARAM) 0); 00593 break; 00594 case VK_DOWN: 00595 SendMessage (hwnd, WM_VSCROLL, SB_LINEDOWN, (LPARAM) 0); 00596 break; 00597 case VK_LEFT: 00598 SendMessage (hwnd, WM_HSCROLL, SB_LINELEFT, (LPARAM) 0); 00599 break; 00600 case VK_RIGHT: 00601 SendMessage (hwnd, WM_HSCROLL, SB_LINERIGHT, (LPARAM) 0); 00602 break; 00603 00604 /* Touches Control-V effectue un "coller" du presse papier */ 00605 case VK_V : 00606 { 00607 SendMessage (hwnd, WM_COMMAND,M_PASTE, (LPARAM) 0); 00608 } 00609 break; 00610 /* Touches Control-Insert Control-C effectue un "copier" dans presse papier */ 00611 case VK_INSERT : 00612 { 00613 LPTW lptw=GetTextWinScilab(); 00614 if ( HasAZoneTextSelected(lptw) == TRUE ) TextCopyClip (lptw); 00615 } 00616 break; 00617 00618 case VK_ADD : 00619 if (!IsEnableTransparencyMode()) 00620 { 00621 LPTW lptw=GetTextWinScilab(); 00622 ActivateTransparencyMode(lptw->hWndParent); 00623 ActivateTransparencyMode(lptw->hWndText); 00624 } 00625 IncreaseAlphaLevel(); 00626 break; 00627 case VK_SUBTRACT: 00628 if (!IsEnableTransparencyMode()) 00629 { 00630 LPTW lptw=GetTextWinScilab(); 00631 ActivateTransparencyMode(lptw->hWndParent); 00632 ActivateTransparencyMode(lptw->hWndText); 00633 } 00634 DecreaseAlphaLevel(); 00635 break; 00636 00637 default: 00638 break; 00639 } 00640 } 00641 else 00642 { 00643 switch (vk) 00644 { 00645 case VK_UP: case VK_DOWN: case VK_LEFT: case VK_RIGHT: 00646 case VK_HOME: case VK_END: case VK_PRIOR: 00647 case VK_NEXT: case VK_DELETE: 00648 { /* store key in circular buffer */ 00649 LPTW lptw=GetTextWinScilab(); 00650 long count; 00651 00652 count = lptw->KeyBufIn - lptw->KeyBufOut; 00653 00654 if (count < 0) count += lptw->KeyBufSize; 00655 00656 if (count < (int) lptw->KeyBufSize - 2) 00657 { 00658 *lptw->KeyBufIn++ = 0; 00659 if (lptw->KeyBufIn - lptw->KeyBuf >= (int) lptw->KeyBufSize) lptw->KeyBufIn = lptw->KeyBuf; /* wrap around */ 00660 00661 *lptw->KeyBufIn++ = flags; 00662 if (lptw->KeyBufIn - lptw->KeyBuf >= (int) lptw->KeyBufSize) lptw->KeyBufIn = lptw->KeyBuf; /* wrap around */ 00663 } 00664 } 00665 break; 00666 00667 /* Appel l'aide */ 00668 case VK_F1: 00669 { 00670 StoreCommand1 ("help()", 0); 00671 } 00672 break; 00673 00674 /* Efface la fenetre de commandes */ 00675 case VK_F2: 00676 { 00677 LPTW lptw=GetTextWinScilab(); 00678 ClearCommandWindow(lptw,TRUE); 00679 } 00680 break; 00681 00682 case VK_F3: 00683 { 00684 LPTW lptw=GetTextWinScilab(); 00685 if (lptw->lpmw->LockToolBar == FALSE) 00686 { 00687 lptw->lpmw->ShowToolBar=!lptw->lpmw->ShowToolBar; 00688 00689 ToolBarOnOff(lptw); 00690 } 00691 } 00692 break; 00693 00694 /* Reset des Menus & Boutons*/ 00695 case VK_F11: 00696 { 00697 ResetMenu(); 00698 } 00699 break; 00700 00701 /* Affiche ou cache la fenetre Scilex */ 00702 case VK_F12: 00703 { 00704 SwitchConsole(); 00705 SetActiveWindow(hwnd); 00706 } 00707 break; 00708 } 00709 } 00710 } 00711 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void ON_WND_TEXT_WM_KILLFOCUS | ( | HWND | hwnd, | |
| HWND | hwndNewFocus | |||
| ) |
Definition at line 873 of file WndConsoleTextProc.c.
References tagTW::bFocus, FALSE, and GetTextWinScilab().
Referenced by WndTextProc().
00874 { 00875 LPTW lptw=GetTextWinScilab(); 00876 DestroyCaret (); 00877 lptw->bFocus = FALSE; 00878 }
Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 495 of file WndConsoleTextProc.c.
References tagTW::CharSize, ClearMark(), GetTextWinScilab(), tagTW::Marking, pt, tagTW::ScrollPos, and TRUE.
Referenced by WndTextProc().
00496 { 00497 LPTW lptw=GetTextWinScilab(); 00498 POINT pt; 00499 00500 pt.x = x; 00501 pt.y = y; 00502 pt.x = (pt.x + lptw->ScrollPos.x)/lptw->CharSize.x; 00503 pt.y = (pt.y + lptw->ScrollPos.y)/lptw->CharSize.y; 00504 ClearMark(lptw, pt); 00505 SetCapture(hwnd); /* track the mouse */ 00506 lptw->Marking = TRUE; 00507 }
Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 449 of file WndConsoleTextProc.c.
References FALSE, GetTextWinScilab(), HasAZoneTextSelected(), tagTW::hPopMenu, M_COPY_CLIP, M_EVALSELECTION, M_HELPON, M_OPENSELECTION, M_PRINTSELECTION, tagTW::MarkBegin, tagTW::MarkEnd, tagTW::Marking, and tagTW::ScreenSize.
Referenced by WndTextProc().
00450 { 00451 LPTW lptw=GetTextWinScilab(); 00452 00453 /* finish marking text */ 00454 00455 ReleaseCapture (); 00456 lptw->Marking = FALSE; 00457 00458 00459 /* ensure begin mark is before end mark */ 00460 00461 if ((lptw->ScreenSize.x * lptw->MarkBegin.y + lptw->MarkBegin.x) > 00462 (lptw->ScreenSize.x * lptw->MarkEnd.y + lptw->MarkEnd.x)) 00463 { 00464 POINT tmp; 00465 tmp.x = lptw->MarkBegin.x; 00466 tmp.y = lptw->MarkBegin.y; 00467 lptw->MarkBegin.x = lptw->MarkEnd.x; 00468 lptw->MarkBegin.y = lptw->MarkEnd.y; 00469 lptw->MarkEnd.x = tmp.x; 00470 lptw->MarkEnd.y = tmp.y; 00471 } 00472 00473 if ( HasAZoneTextSelected(lptw) ) 00474 { 00475 /* Zone Selectionnée --> Activation Menus */ 00476 EnableMenuItem(lptw->hPopMenu,M_COPY_CLIP,MF_ENABLED); 00477 EnableMenuItem(lptw->hPopMenu,M_HELPON,MF_ENABLED); 00478 EnableMenuItem(lptw->hPopMenu,M_PRINTSELECTION,MF_ENABLED); 00479 EnableMenuItem(lptw->hPopMenu,M_OPENSELECTION,MF_ENABLED); 00480 EnableMenuItem(lptw->hPopMenu,M_EVALSELECTION,MF_ENABLED); 00481 /* EnableMenuItem(lptw->hPopMenu,M_CUT,MF_ENABLED); */ 00482 } 00483 else 00484 { 00485 /*Pas de Zone Selectionnée -> Menus non activés */ 00486 /* EnableMenuItem(lptw->hPopMenu,M_CUT,MF_GRAYED); */ 00487 EnableMenuItem(lptw->hPopMenu,M_COPY_CLIP,MF_GRAYED); 00488 EnableMenuItem(lptw->hPopMenu,M_HELPON,MF_GRAYED); 00489 EnableMenuItem(lptw->hPopMenu,M_PRINTSELECTION,MF_GRAYED); 00490 EnableMenuItem(lptw->hPopMenu,M_OPENSELECTION,MF_GRAYED); 00491 EnableMenuItem(lptw->hPopMenu,M_EVALSELECTION,MF_GRAYED); 00492 } 00493 }
Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 509 of file WndConsoleTextProc.c.
References FALSE, GetTextWinScilab(), and PasteFunction().
Referenced by WndTextProc().
00510 { 00511 LPTW lptw=GetTextWinScilab(); 00512 PasteFunction(lptw,FALSE); 00513 }
Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 376 of file WndConsoleTextProc.c.
References tagTW::CharSize, GetTextWinScilab(), tagTW::hWndText, LimitMark(), tagTW::Marking, max, min, NULL, pt, SB_HORZ, SB_VERT, tagTW::ScrollMax, tagTW::ScrollPos, TRUE, and UpdateMark().
Referenced by WndTextProc().
00377 { 00378 LPTW lptw=GetTextWinScilab(); 00379 00380 if ((keyFlags & MK_LBUTTON) && lptw->Marking) 00381 { 00382 RECT rect; 00383 POINT pt; 00384 pt.x = x; 00385 pt.y = y; 00386 00387 GetClientRect (hwnd, &rect); 00388 if (PtInRect (&rect, pt)) 00389 { 00390 pt.x = (pt.x + lptw->ScrollPos.x) / lptw->CharSize.x; 00391 pt.y = (pt.y + lptw->ScrollPos.y) / lptw->CharSize.y; 00392 UpdateMark (lptw, pt); 00393 } 00394 else 00395 { 00396 int nXinc; 00397 int nYinc; 00398 do 00399 { 00400 nXinc = 0; 00401 nYinc = 0; 00402 if (pt.x > rect.right) 00403 { 00404 nXinc = lptw->CharSize.x * 4; 00405 pt.x = (rect.right + lptw->ScrollPos.x) / lptw->CharSize.x + 2; 00406 } 00407 else if (pt.x < rect.left) 00408 { 00409 nXinc = -lptw->CharSize.x * 4; 00410 pt.x = (rect.left + lptw->ScrollPos.x) / lptw->CharSize.x - 2; 00411 } 00412 else 00413 pt.x = (pt.x + lptw->ScrollPos.x) / lptw->CharSize.x; 00414 if (pt.y > rect.bottom) 00415 { 00416 nYinc = lptw->CharSize.y; 00417 pt.y = (rect.bottom + lptw->ScrollPos.y) / lptw->CharSize.y + 1; 00418 } 00419 else if (pt.y < rect.top) 00420 { 00421 nYinc = -lptw->CharSize.y; 00422 pt.y = (rect.top + lptw->ScrollPos.y) / lptw->CharSize.y - 1; 00423 } 00424 else pt.y = (pt.y + lptw->ScrollPos.y) / lptw->CharSize.y; 00425 00426 LimitMark (lptw, &pt); 00427 nXinc = max (nXinc, -lptw->ScrollPos.x); 00428 nYinc = max (nYinc, -lptw->ScrollPos.y); 00429 nYinc = min (nYinc, lptw->ScrollMax.y - lptw->ScrollPos.y); 00430 nXinc = min (nXinc, lptw->ScrollMax.x - lptw->ScrollPos.x); 00431 if (nYinc || nXinc) 00432 { 00433 lptw->ScrollPos.y += nYinc; 00434 lptw->ScrollPos.x += nXinc; 00435 ScrollWindow (lptw->hWndText, -nXinc, -nYinc, NULL, NULL); 00436 SetScrollPos (lptw->hWndText, SB_VERT, lptw->ScrollPos.y, TRUE); 00437 SetScrollPos (lptw->hWndText, SB_HORZ, lptw->ScrollPos.x, TRUE); 00438 UpdateWindow (lptw->hWndText); 00439 } 00440 UpdateMark (lptw, pt); 00441 GetCursorPos (&pt); 00442 ScreenToClient (hwnd, &pt); 00443 } 00444 while ((nYinc || nXinc) && !PtInRect (&rect, pt) && (GetAsyncKeyState (VK_LBUTTON) < 0)); 00445 } 00446 } 00447 }
Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 821 of file WndConsoleTextProc.c.
Referenced by WndTextProc().
00822 { 00823 if (zDelta!=0) 00824 { 00825 int steps=yPos/zDelta; 00826 00827 if( steps > 0 ) 00828 { 00829 SendMessage (hwnd, WM_VSCROLL, SB_LINEUP, (LPARAM) 0); 00830 } 00831 00832 if( steps < 0 ) 00833 { 00834 SendMessage (hwnd, WM_VSCROLL, SB_LINEDOWN, (LPARAM) 0); 00835 } 00836 } 00837 }
Here is the caller graph for this function:

| BOOL ON_WND_TEXT_WM_PAINT | ( | HWND | hwnd | ) |
Definition at line 147 of file WndConsoleTextProc.c.
References tagTW::CharSize, count, DoLine(), GetTextWinScilab(), tagTW::hbrBackground, hdc, tagTW::hfont, tagTW::MarkBegin, tagTW::MarkEnd, offset, ResizeScreenBuffer(), tagTW::ScreenBuffer, tagTW::ScreenSize, tagTW::ScrollPos, TextWhereY(), TRUE, and width.
Referenced by WndTextProc().
00148 { 00149 HDC hdc; 00150 PAINTSTRUCT ps; 00151 RECT rect; 00152 LPTW lptw=GetTextWinScilab(); 00153 00154 POINT source, width, dest; 00155 POINT MarkBegin, MarkEnd; 00156 00157 if (TextWhereY(lptw)+50 > lptw->ScreenSize.y) ResizeScreenBuffer(lptw); 00158 00159 hdc = BeginPaint (hwnd, &ps); 00160 GetClientRect (hwnd, &rect); 00161 FillRect (hdc, &rect, lptw->hbrBackground); 00162 if (ps.fErase) FillRect (hdc, &ps.rcPaint, lptw->hbrBackground); 00163 00164 SelectFont (hdc, lptw->hfont); 00165 SetMapMode (hdc, MM_TEXT); 00166 SetBkMode (hdc, OPAQUE); 00167 GetClientRect (hwnd, &rect); 00168 source.x = (rect.left + lptw->ScrollPos.x) / lptw->CharSize.x; /* source */ 00169 source.y = (rect.top + lptw->ScrollPos.y) / lptw->CharSize.y; 00170 dest.x = source.x * lptw->CharSize.x - lptw->ScrollPos.x; /* destination */ 00171 dest.y = source.y * lptw->CharSize.y - lptw->ScrollPos.y; 00172 width.x = ((rect.right + lptw->ScrollPos.x + lptw->CharSize.x - 1) / lptw->CharSize.x) - source.x; /* width */ 00173 width.y = ((rect.bottom + lptw->ScrollPos.y + lptw->CharSize.y - 1) / lptw->CharSize.y) - source.y; 00174 00175 if (source.x < 0) source.x = 0; 00176 if (source.y < 0) source.y = 0; 00177 if (source.x + width.x > lptw->ScreenSize.x) width.x = lptw->ScreenSize.x - source.x; 00178 if (source.y + width.y > lptw->ScreenSize.y) width.y = lptw->ScreenSize.y - source.y; 00179 /* ensure begin mark is before end mark */ 00180 if ((lptw->ScreenSize.x * lptw->MarkBegin.y + lptw->MarkBegin.x) > 00181 (lptw->ScreenSize.x * lptw->MarkEnd.y + lptw->MarkEnd.x)) 00182 { 00183 MarkBegin.x = lptw->MarkEnd.x; 00184 MarkBegin.y = lptw->MarkEnd.y; 00185 MarkEnd.x = lptw->MarkBegin.x; 00186 MarkEnd.y = lptw->MarkBegin.y; 00187 } 00188 else 00189 { 00190 MarkBegin.x = lptw->MarkBegin.x; 00191 MarkBegin.y = lptw->MarkBegin.y; 00192 MarkEnd.x = lptw->MarkEnd.x; 00193 MarkEnd.y = lptw->MarkEnd.y; 00194 } 00195 /* for each line */ 00196 while (width.y > 0) 00197 { 00198 if ((source.y >= MarkBegin.y) && (source.y <= MarkEnd.y)) 00199 { 00200 int start, end; 00201 int count, offset; 00202 00203 if (source.y == MarkBegin.y) start = MarkBegin.x; 00204 else start = 0; 00205 00206 if (source.y == MarkEnd.y) end = MarkEnd.x; 00207 else end = lptw->ScreenSize.x; 00208 00209 /* do stuff before marked text */ 00210 offset = 0; 00211 count = start - source.x; 00212 if (count > 0) DoLine (lptw, hdc, dest.x, dest.y,source.y * lptw->ScreenSize.x + source.x, count); 00213 00214 /* then the marked text */ 00215 offset += count; 00216 count = end - start; 00217 if ((count > 0) && (offset < width.x)) 00218 { 00219 SetTextColor (hdc, GetSysColor (COLOR_HIGHLIGHTTEXT)); 00220 SetBkColor (hdc, GetSysColor (COLOR_HIGHLIGHT)); 00221 00222 TextOut (hdc, dest.x + lptw->CharSize.x * offset, dest.y, 00223 (LPSTR) (lptw->ScreenBuffer + source.y * lptw->ScreenSize.x 00224 + source.x + offset), count); 00225 } 00226 00227 /* then stuff after marked text */ 00228 offset += count; 00229 count = width.x + source.x - end; 00230 if ((count > 0) && (offset < width.x)) DoLine (lptw, hdc, dest.x + lptw->CharSize.x * offset, dest.y, 00231 source.y * lptw->ScreenSize.x + source.x + offset, count); 00232 } 00233 else 00234 { 00235 DoLine (lptw, hdc, dest.x, dest.y,source.y * lptw->ScreenSize.x + source.x, width.x); 00236 } 00237 dest.y += lptw->CharSize.y; 00238 source.y++; 00239 width.y--; 00240 } 00241 EndPaint (hwnd, &ps); 00242 00243 return TRUE; 00244 }
Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 515 of file WndConsoleTextProc.c.
References GetTextWinScilab(), tagTW::hPopMenu, IsEmptyClipboard(), M_PASTE, M_SPECIALPASTE, NULL, and pt.
Referenced by WndTextProc().
00516 { 00517 LPTW lptw=GetTextWinScilab(); 00518 POINT pt; 00519 pt.x = x; 00520 pt.y = y; 00521 00522 ClientToScreen (hwnd, &pt); 00523 00524 if ( IsEmptyClipboard(lptw) ) 00525 { 00526 EnableMenuItem(lptw->hPopMenu,M_PASTE,MF_GRAYED); 00527 EnableMenuItem(lptw->hPopMenu,M_SPECIALPASTE,MF_GRAYED); 00528 } 00529 else 00530 { 00531 EnableMenuItem(lptw->hPopMenu,M_PASTE,MF_ENABLED); 00532 EnableMenuItem(lptw->hPopMenu,M_SPECIALPASTE,MF_ENABLED); 00533 } 00534 00535 TrackPopupMenu (lptw->hPopMenu, TPM_LEFTALIGN, pt.x, pt.y, 0, hwnd, NULL); 00536 }
Here is the call graph for this function:

Here is the caller graph for this function:

| BOOL ON_WND_TEXT_WM_SETCURSOR | ( | HWND | hwnd, | |
| HWND | hwndCursor, | |||
| UINT | codeHitTest, | |||
| UINT | msg | |||
| ) |
Definition at line 891 of file WndConsoleTextProc.c.
Referenced by WndTextProc().
Here is the caller graph for this function:

| void ON_WND_TEXT_WM_SETFOCUS | ( | HWND | hwnd, | |
| HWND | hwndOldFocus | |||
| ) |
Definition at line 880 of file WndConsoleTextProc.c.
References tagTW::bFocus, tagTW::bGetCh, tagTW::CaretHeight, tagTW::CharAscent, tagTW::CharSize, tagTW::CursorPos, GetTextWinScilab(), tagTW::ScrollPos, and TRUE.
Referenced by WndTextProc().
00881 { 00882 LPTW lptw=GetTextWinScilab(); 00883 lptw->bFocus = TRUE; 00884 CreateCaret (hwnd, 0, lptw->CharSize.x, 2 + lptw->CaretHeight); 00885 SetCaretPos (lptw->CursorPos.x * lptw->CharSize.x - lptw->ScrollPos.x, 00886 lptw->CursorPos.y * lptw->CharSize.y + lptw->CharAscent 00887 - lptw->CaretHeight - lptw->ScrollPos.y); 00888 if (lptw->bGetCh) ShowCaret (hwnd); 00889 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void ON_WND_TEXT_WM_SETTEXT | ( | HWND | hwnd, | |
| LPCTSTR | lpszText | |||
| ) |
Definition at line 371 of file WndConsoleTextProc.c.
References CreateThreadPaste().
Referenced by WndTextProc().
00372 { 00373 CreateThreadPaste((char*)lpszText); 00374 }
Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 839 of file WndConsoleTextProc.c.
References tagTW::bFocus, tagTW::bGetCh, C2F, tagTW::CaretHeight, tagTW::CharAscent, tagTW::CharSize, tagTW::ClientSize, tagTW::CursorPos, FALSE, GetTextWinScilab(), max, min, nc, nl, SB_HORZ, SB_VERT, scilines(), tagTW::ScreenSize, tagTW::ScrollMax, tagTW::ScrollPos, and TRUE.
Referenced by WndTextProc().
00840 { 00841 int nl=0, nc=0; 00842 LPTW lptw=GetTextWinScilab(); 00843 00844 lptw->ClientSize.y = cy; 00845 lptw->ClientSize.x = cx; 00846 nc = lptw->ClientSize.x / lptw->CharSize.x; 00847 nl = lptw->ClientSize.y / lptw->CharSize.y; 00849 if ((cx>0) && (cy>0)) C2F (scilines) (&nl, &nc); 00850 00851 lptw->ScrollMax.y = max (0, lptw->CharSize.y * lptw->ScreenSize.y - lptw->ClientSize.y); 00852 lptw->ScrollPos.y = min (lptw->ScrollPos.y, lptw->ScrollMax.y); 00853 00854 SetScrollRange (hwnd, SB_VERT, 0, lptw->ScrollMax.y, FALSE); 00855 SetScrollPos (hwnd, SB_VERT, lptw->ScrollPos.y, TRUE); 00856 00857 lptw->ScrollMax.x = max (0, lptw->CharSize.x * lptw->ScreenSize.x - lptw->ClientSize.x); 00858 lptw->ScrollPos.x = min (lptw->ScrollPos.x, lptw->ScrollMax.x); 00859 00860 SetScrollRange (hwnd, SB_HORZ, 0, lptw->ScrollMax.x, FALSE); 00861 SetScrollPos (hwnd, SB_HORZ, lptw->ScrollPos.x, TRUE); 00862 00863 00864 if (lptw->bFocus && lptw->bGetCh) 00865 { 00866 SetCaretPos (lptw->CursorPos.x * lptw->CharSize.x - lptw->ScrollPos.x, 00867 lptw->CursorPos.y * lptw->CharSize.y + lptw->CharAscent 00868 - lptw->CaretHeight - lptw->ScrollPos.y); 00869 ShowCaret (hwnd); 00870 } 00871 }
Here is the call graph for this function:

Here is the caller graph for this function:

| BOOL ON_WND_TEXT_WM_SYSCOLORCHANGE | ( | HWND | hwnd | ) |
Definition at line 246 of file WndConsoleTextProc.c.
References tagTW::bSysColors, GetTextWinScilab(), InitIhmDefaultColor(), SetIhmSystemDefaultTextBackgroundColor(), SetIhmSystemDefaultTextColor(), and TRUE.
Referenced by WndTextProc().
00247 { 00248 LPTW lptw=GetTextWinScilab(); 00249 00250 if (lptw->bSysColors) 00251 { 00252 InitIhmDefaultColor(); 00253 SetIhmSystemDefaultTextBackgroundColor(); 00254 SetIhmSystemDefaultTextColor(); 00255 } 00256 return TRUE; 00257 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void ON_WND_TEXT_WM_VSCROLL | ( | HWND | hwnd, | |
| HWND | hwndCtl, | |||
| UINT | code, | |||
| int | pos | |||
| ) |
Definition at line 713 of file WndConsoleTextProc.c.
References tagTW::CharSize, tagTW::ClientSize, GetTextWinScilab(), max, min, NULL, SB_VERT, tagTW::ScrollMax, tagTW::ScrollPos, and TRUE.
Referenced by WndTextProc().
00714 { 00715 int nYinc=0; 00716 00717 LPTW lptw=GetTextWinScilab(); 00718 switch (code) 00719 { 00720 case SB_ENDSCROLL: 00721 nYinc = 0; 00722 break; 00723 case SB_TOP: 00724 nYinc = -lptw->ScrollPos.y; 00725 break; 00726 case SB_BOTTOM: 00727 nYinc = lptw->ScrollMax.y - lptw->ScrollPos.y; 00728 break; 00729 case SB_LINEUP: 00730 nYinc = -lptw->CharSize.y; 00731 break; 00732 case SB_LINEDOWN: 00733 nYinc = lptw->CharSize.y; 00734 break; 00735 case SB_PAGEUP: 00736 nYinc = min(-1,-lptw->ClientSize.y); 00737 break; 00738 case SB_PAGEDOWN: 00739 nYinc = max(1,lptw->ClientSize.y); 00740 break; 00741 case SB_THUMBPOSITION: 00742 nYinc = pos - lptw->ScrollPos.y; 00743 break; 00744 case SB_THUMBTRACK: 00745 nYinc = pos - lptw->ScrollPos.y; 00746 break; 00747 default: 00748 nYinc = 0; 00749 break; 00750 00751 } 00752 00753 if ((nYinc = max (-lptw->ScrollPos.y,min (nYinc, lptw->ScrollMax.y - lptw->ScrollPos.y))) != 0) 00754 { 00755 lptw->ScrollPos.y += nYinc; 00756 ScrollWindow (hwnd, 0, -nYinc, NULL, NULL); 00757 SetScrollPos (hwnd, SB_VERT, lptw->ScrollPos.y, TRUE); 00758 UpdateWindow (hwnd); 00759 } 00760 00761 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void OpenSelection | ( | LPTW | lptw | ) |
Definition at line 1249 of file wtext.c.
Referenced by ON_WND_TEXT_WM_COMMAND().
01251 { 01252 HDC hdc; 01253 HGLOBAL hGMem; 01254 01255 TEXTMETRIC tm; 01256 UINT type; 01257 LPSTR lpMem; /* Pointeur sur la chaine du clipboard */ 01258 char *MessagePaste=NULL; 01259 char FileName[MAX_PATH]; 01260 char FileNameSCE[MAX_PATH]; 01261 char FileNameSCI[MAX_PATH]; 01262 char Command[MAX_PATH]; 01263 01264 01265 /* Copie dans le presse papier */ 01266 /* La zone sélectionnée */ 01267 TextCopyClip (lptw); 01268 01269 /*Récupere ce qu'il y a dans le presse papier*/ 01270 01271 hdc = GetDC (lptw->hWndText); 01272 SelectFont (hdc, lptw->hfont); 01273 GetTextMetrics (hdc, (TEXTMETRIC *) & tm); 01274 if (tm.tmCharSet == OEM_CHARSET) type = CF_OEMTEXT; 01275 else type = CF_TEXT; 01276 ReleaseDC (lptw->hWndText, hdc); 01277 /* now get it from clipboard */ 01278 OpenClipboard (lptw->hWndText); 01279 hGMem = GetClipboardData (type); 01280 if (hGMem) 01281 { 01282 int i=0; 01283 int l=0; 01284 01285 lpMem= GlobalLock (hGMem); 01286 l=strlen(lpMem); 01287 MessagePaste=(char*)MALLOC(l*sizeof(char)); 01288 strcpy(MessagePaste,lpMem); 01289 GlobalUnlock (hGMem); 01290 01291 01292 01293 01294 /* On enleve et retour chariot */ 01295 l=strlen(MessagePaste); 01296 for (i=0;i<l;i++) 01297 { 01298 if (MessagePaste[i]=='\n') MessagePaste[i]='\0'; 01299 if (MessagePaste[i]=='\r') MessagePaste[i]='\0'; 01300 } 01301 } 01302 CloseClipboard (); 01303 01304 strcpy(FileName,MessagePaste); 01305 01306 strcpy(FileNameSCI,MessagePaste); 01307 strcat(FileNameSCI,".sci"); 01308 01309 strcpy(FileNameSCE,MessagePaste); 01310 strcat(FileNameSCE,".sce"); 01311 01312 //MessageBox(NULL,FileName,FileName,MB_OK); 01313 01314 if ( IsAFile(FileNameSCI) ) 01315 { 01316 char Fichier[MAX_PATH]; 01317 GetShortPathName(FileNameSCI,Fichier,MAX_PATH); 01318 ReplaceSlash(FileNameSCI,Fichier); 01319 wsprintf(Command,"scipad('%s')",FileNameSCI); 01320 01321 StoreCommand1 (Command, 0); 01322 return ; 01323 } 01324 01325 if ( IsAFile(FileNameSCE) ) 01326 { 01327 char Fichier[MAX_PATH]; 01328 GetShortPathName(FileNameSCE,Fichier,MAX_PATH); 01329 ReplaceSlash(FileNameSCE,Fichier); 01330 wsprintf(Command,"scipad('%s')",FileNameSCE); 01331 StoreCommand1 (Command, 0); 01332 return ; 01333 } 01334 01335 if ( IsAFile(FileName) ) 01336 { 01337 char Fichier[MAX_PATH]; 01338 GetShortPathName(FileName,Fichier,MAX_PATH); 01339 ReplaceSlash(FileName,Fichier); 01340 //MessageBox(NULL,FileName,Fichier,MB_OK); 01341 wsprintf(Command,"scipad('%s')",FileName); 01342 StoreCommand1 (Command, 0); 01343 return ; 01344 } 01345 else 01346 { 01347 /*cree un fichier avec l'extension SCI */ 01348 char Message[MAX_PATH]; 01349 01350 wsprintf(Message,MSG_SCIMSG81,FileNameSCI); 01351 if ( MessageBox(lptw->hWndText,Message,MSG_SCIMSG82,MB_YESNO|MB_ICONWARNING)== IDYES ) 01352 { 01353 FILE *fp; 01354 char Fichier[MAX_PATH]; 01355 01356 fp=fopen(FileNameSCI,"wt"); 01357 if ( fp ) 01358 { 01359 fclose(fp); 01360 GetShortPathName(FileNameSCI,Fichier,MAX_PATH); 01361 ReplaceSlash(FileNameSCI,Fichier); 01362 wsprintf(Command,"scipad('%s')",FileNameSCI); 01363 StoreCommand1 (Command, 0); 01364 } 01365 else 01366 { 01367 sciprint(MSG_ERROR57); 01368 SendCTRLandAKey(CTRLL); 01369 } 01370 01371 } 01372 } 01373 01374 01375 }
Here is the caller graph for this function:

| void PasteFunction | ( | LPTW | lptw, | |
| BOOL | special | |||
| ) |
Definition at line 132 of file clipboard.c.
References hdc, tagTW::hfont, tagTW::hWndText, SpecialPaste, TEXTMETRIC, ThreadPasteRunning, TryToGetDC(), type, and UINT.
Referenced by Callback_PASTE(), ON_WND_TEXT_WM_COMMAND(), and ON_WND_TEXT_WM_MBUTTONUP().
00138 { 00139 HDC hdc; 00140 HGLOBAL hGMem; 00141 TEXTMETRIC tm; 00142 UINT type; 00143 LPSTR lpMem; /* Pointeur sur la chaine du clipboard */ 00144 00145 SpecialPaste=special; 00146 /* find out what type to get from clipboard */ 00147 hdc = (HDC)TryToGetDC (lptw->hWndText); 00148 SelectObject(hdc, lptw->hfont); 00149 GetTextMetrics(hdc,(TEXTMETRIC FAR *)&tm); 00150 if (tm.tmCharSet == OEM_CHARSET) type = CF_OEMTEXT; 00151 else type = CF_TEXT; 00152 ReleaseDC (lptw->hWndText, hdc); 00153 00154 /* now get it from clipboard */ 00155 OpenClipboard (lptw->hWndText); 00156 hGMem = GetClipboardData (type); 00157 00158 if (hGMem) 00159 { 00160 lpMem = GlobalLock( hGMem ); 00161 if (!ThreadPasteRunning) SendMessage(lptw->hWndText, WM_SETTEXT, 0,(LPARAM) lpMem); 00162 GlobalUnlock (hGMem); 00163 } 00164 CloseClipboard (); 00165 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void PrintSelectionGUI | ( | LPTW | lptw, | |
| char * | Entete | |||
| ) |
Definition at line 9 of file TextToPrint.c.
00010 { 00011 PrintSelection(lptw->hWndText,Entete,lptw->hfont); 00012 }
| void ResetMenu | ( | void | ) |
Definition at line 1894 of file wmenu.c.
References GetTextWinScilab(), and ReLoadMenus().
01895 { 01896 LPTW lptw=GetTextWinScilab(); 01897 ReLoadMenus(lptw); 01898 }
Here is the call graph for this function:

| void ResizeScreenBuffer | ( | LPTW | lptw | ) |
Definition at line 1593 of file wtext.c.
Referenced by ON_WND_TEXT_WM_PAINT().
01594 { 01595 #define ScreenBufferSizeMaxY 25200 /* Valeur pour compatibilité avec W9x */ 01596 01597 01598 /* Limitation de la taille du buffer d'ecran */ 01599 if (lptw->ScreenSize.y < ScreenBufferSizeMaxY ) 01600 { 01601 /* On agrandit le buffer écran */ 01602 ReAllocScreenBuffer(lptw); 01603 } 01604 else 01605 { 01606 /* On remonte dans le buffer écran */ 01607 ReorganizeScreenBuffer(lptw); 01608 01609 } 01610 01611 /* Mise à jour Scrollbar*/ 01612 SetScrollRange (lptw->hWndText, SB_VERT, 0, lptw->ScrollMax.y, FALSE); 01613 01614 SetScrollPos (lptw->hWndText, SB_VERT, lptw->ScrollPos.y, TRUE); 01615 01616 SetScrollPos (lptw->hWndText, SB_HORZ, lptw->ScrollPos.x, TRUE); 01617 01618 01619 01620 }
Here is the caller graph for this function:

| void SaveCurrentLine | ( | BOOL | RewriteLineAtPrompt | ) |
Definition at line 145 of file x_zzledt.c.
References copycur_line, cur_line, FALSE, get_is_reading(), PutLineInBuffer, and TRUE.
00146 { 00147 extern char cur_line[1024]; 00148 00149 if ( (get_is_reading ()) && (PutLineInBuffer == FALSE) ) 00150 { 00151 strcpy(copycur_line,cur_line); 00152 if (RewriteLineAtPrompt) PutLineInBuffer=TRUE; 00153 } 00154 }
Here is the call graph for this function:

Definition at line 294 of file x_test_loop.c.
Referenced by ChangeCursorWhenScilabIsReady(), ON_WND_TEXT_WM_SIZE(), and Size2Scilab().
Here is the caller graph for this function:

| void SelectAll | ( | LPTW | lptw, | |
| BOOL | DoAMark | |||
| ) |
Definition at line 1850 of file wtext.c.
Referenced by Callback_PRINT(), Callback_SELECTALL(), and ON_WND_TEXT_WM_COMMAND().
01851 { 01852 POINT pt; 01853 pt.x = 0; 01854 pt.y = 0; 01855 pt.x = (pt.x + lptw->ScrollPos.x)/lptw->CharSize.x; 01856 pt.y = (pt.y + lptw->ScrollPos.y)/lptw->CharSize.y; 01857 ClearMark(lptw, pt); 01858 01859 lptw->MarkBegin.x=0; 01860 lptw->MarkBegin.y=0; 01861 lptw->MarkEnd.x=lptw->CursorPos.x; 01862 lptw->MarkEnd.y=lptw->CursorPos.y; 01863 01864 SendMessage (lptw->hWndText, WM_HSCROLL,SB_LEFT, (LPARAM) 0); 01865 SendMessage (lptw->hWndText, WM_VSCROLL, SB_TOP, (LPARAM) 0); 01866 01867 01868 if (DoAMark) 01869 { 01870 DoMark (lptw, lptw->MarkBegin,lptw->MarkEnd, TRUE); 01871 01872 01873 if ((lptw->ScreenSize.x * lptw->MarkBegin.y + lptw->MarkBegin.x) > 01874 (lptw->ScreenSize.x * lptw->MarkEnd.y + lptw->MarkEnd.x)) 01875 { 01876 POINT tmp; 01877 tmp.x = lptw->MarkBegin.x; 01878 tmp.y = lptw->MarkBegin.y; 01879 lptw->MarkBegin.x = lptw->MarkEnd.x; 01880 lptw->MarkBegin.y = lptw->MarkEnd.y; 01881 lptw->MarkEnd.x = tmp.x; 01882 lptw->MarkEnd.y = tmp.y; 01883 } 01884 } 01885 if ( HasAZoneTextSelected(lptw) ) 01886 { 01887 /* Zone Selectionnée --> Activation Menus */ 01888 EnableMenuItem(lptw->hPopMenu,M_COPY_CLIP,MF_ENABLED); 01889 EnableMenuItem(lptw->hPopMenu,M_HELPON,MF_ENABLED); 01890 EnableMenuItem(lptw->hPopMenu,M_PRINTSELECTION,MF_ENABLED); 01891 EnableMenuItem(lptw->hPopMenu,M_OPENSELECTION,MF_ENABLED); 01892 EnableMenuItem(lptw->hPopMenu,M_EVALSELECTION,MF_ENABLED); 01893 /* EnableMenuItem(lptw->hPopMenu,M_CUT,MF_ENABLED); */ 01894 01895 } 01896 01897 }
Here is the caller graph for this function:

| void SendMacro | ( | LPTW | lptw, | |
| UINT | m | |||
| ) |
Definition at line 637 of file wmenu.c.
References ABORT, ABOUT, BACKGROUNDCOLOR, buf, BUGZILLA, Callback_ABORT(), Callback_ABOUT(), Callback_BACKGROUNDCOLOR(), Callback_BUGZILLA(), Callback_CHDIR(), Callback_CHOOSETHEFONT(), Callback_CLEARCOMMANDWINDOW(), Callback_CLEARHISTORY(), Callback_CONFIGUREBROWSER(), Callback_CONSOLE(), Callback_CONTRIBUTIONS(), Callback_DEMOS(), Callback_EMAIL(), Callback_EMPTYCLIPBOARD(), Callback_ENGLISH(), Callback_EXEC(), Callback_FILESASSOCIATIONBOX(), Callback_FRENCH(), Callback_GETCWD(), Callback_GETF(), Callback_HELP(), Callback_LOAD(), Callback_MCOPY(), Callback_NEWSCILAB(), Callback_NEWSGROUP(), Callback_OPEN(), Callback_PASTE(), Callback_PAUSE(), Callback_PRINT(), Callback_PRINTSETUP(), Callback_RESTART(), Callback_RESUME(), Callback_SAVE(), Callback_SCIPAD(), Callback_SELECTALL(), Callback_SYSTEMCOLOR(), Callback_TEXTCOLOR(), Callback_TOOLBAR(), Callback_WEB(), CHDIR, CHOOSETHEFONT, CLEARCOMMANDWINDOW, CLEARHISTORY, CMDMAX, CMDMIN, CONFIGBROWSER, CONSOLE, CONTRIBUTIONS, CTRLA, CTRLB, CTRLD, CTRLE, CTRLF, CTRLH, CTRLK, CTRLL, CTRLP, CTRLU, CTRLW, DEMOS, EMAIL, EMPTYCLIPBOARD, ENGLISH, EOS, EXEC, EXIT, ExitWindow(), FILESASSOCIATION, FRENCH, GETCWD, GETF, HELP, LOAD, tagTW::lpmw, M_CTRL_A, M_CTRL_B, M_CTRL_C, M_CTRL_D, M_CTRL_E, M_CTRL_F, M_CTRL_H, M_CTRL_K, M_CTRL_L, M_CTRL_P, M_CTRL_U, M_CTRL_W, tagMW::macro, MAXSTR, MCOPY, NEWSCILAB, NEWSGROUP, NULL, NUMMENU, OPEN, PASTE, PAUSE, PRINTSETUP, RESTART, RESUME, s, SAVE, SaveCurrentLine(), ScilabMenuAction(), SCIPAD, SELECTALL, SendCTRLandAKey(), SignalCtrC(), SYSTEMCOLOR, TEXTCOLOR, TOOLBAR, TRUE, WEB, and write_scilab().
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 }
Here is the call graph for this function:

| BOOL SetIhmSystemDefaultTextBackgroundColor | ( | void | ) |
Definition at line 74 of file ihmcolor.c.
References CurrentIHMTextBackgroundColor, FALSE, GetTextWinScilab(), tagTW::hbrBackground, tagTW::hWndParent, tagTW::hWndText, NULL, and TRUE.
Referenced by C2F(), Callback_SYSTEMCOLOR(), ON_WND_CONSOLE_WM_SYSCOLORCHANGE(), and ON_WND_TEXT_WM_SYSCOLORCHANGE().
00075 { 00076 BOOL bOK=FALSE; 00077 00078 HBRUSH NewHbrBackground=NULL; 00079 LPTW lptw=GetTextWinScilab(); 00080 00081 CurrentIHMTextBackgroundColor=GetSysColor(COLOR_WINDOW); 00082 00083 NewHbrBackground=CreateSolidBrush (CurrentIHMTextBackgroundColor); 00084 00085 if (SetClassLong(lptw->hWndParent,GCL_HBRBACKGROUND,(LONG)NewHbrBackground)==0) bOK=FALSE; 00086 else bOK=TRUE; 00087 00088 if ((bOK) && (SetClassLong(lptw->hWndText,GCL_HBRBACKGROUND,(LONG)NewHbrBackground)==0)) bOK=FALSE; 00089 else bOK=TRUE; 00090 00091 if ( (bOK) && (DeleteObject((HBRUSH)(lptw->hbrBackground)))) bOK=TRUE; 00092 else bOK=FALSE; 00093 00094 lptw->hbrBackground=NewHbrBackground; 00095 if ((bOK) && (InvalidateRect (lptw->hWndText, NULL, TRUE))) bOK=TRUE; 00096 else bOK=FALSE; 00097 00098 return bOK; 00099 }
Here is the call graph for this function:

Here is the caller graph for this function:

| BOOL SetIhmSystemDefaultTextColor | ( | void | ) |
Definition at line 63 of file ihmcolor.c.
References CurrentIHMTextColor, FALSE, GetTextWinScilab(), tagTW::hWndText, NULL, and TRUE.
Referenced by C2F(), Callback_SYSTEMCOLOR(), ON_WND_CONSOLE_WM_SYSCOLORCHANGE(), and ON_WND_TEXT_WM_SYSCOLORCHANGE().
00064 { 00065 BOOL bOK=FALSE; 00066 LPTW lptw=GetTextWinScilab(); 00067 00068 CurrentIHMTextColor=GetSysColor(COLOR_WINDOWTEXT); 00069 if (InvalidateRect (lptw->hWndText, NULL, TRUE)) bOK=TRUE; 00070 00071 return bOK; 00072 }
Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 93 of file dynamic_menus.c.
References FREE, IsToThePrompt(), MALLOC, commandRec::next, NULL, p, sciprint(), and write_scilab().
Referenced by Callback_ABORT(), Callback_CHDIR(), Callback_CONFIGUREBROWSER(), Callback_ENGLISH(), Callback_EXEC(), Callback_FRENCH(), Callback_GETF(), Callback_HELP(), Callback_LOAD(), Callback_OPEN(), Callback_PAUSE(), Callback_RESTART(), Callback_RESUME(), Callback_SAVE(), Callback_SCIPAD(), HelpOn(), NewFigure(), ON_WND_CONSOLE_WM_COPYDATA(), ON_WND_TEXT_WM_KEY(), OpenSelection(), scig_click_handler_sci(), scig_deletegwin_handler_sci(), ScilabMenuAction(), SetLanguageMenu(), StoreCommand(), and SwitchLanguage().
00094 { 00095 #ifdef _MSC_VER 00096 if ( (flag == 1) && ( !IsToThePrompt () ) ) flag=0; 00097 #endif 00098 switch (flag) 00099 { 00100 case 1: /* the command is shown in scilab window (if at prompt) */ 00101 { 00102 write_scilab (command); 00103 return (0); 00104 } 00105 break; 00106 case 0: 00107 default : /* the command is not shown in Scilab */ 00108 { 00109 CommandRec *p, *q, *r; 00110 00112 if (scig_command_handler (command) == 1) return 0; 00113 00114 p = (CommandRec *) MALLOC (sizeof (CommandRec)); 00115 if (p == (CommandRec *) 0) 00116 { 00117 sciprint ("send_command : No more memory \r\n"); 00118 return (1); 00119 } 00120 p->flag = 0; 00121 p->command = (char *) MALLOC ((strlen (command) + 1) * sizeof (char)); 00122 if (p->command == (char *) 0) 00123 { 00124 FREE(p); 00125 sciprint ("send_command : No more memory \r\n"); 00126 return (1); 00127 } 00128 strcpy (p->command, command); 00129 p->next = NULL; 00130 if (!commandQueue) commandQueue = p; 00131 else 00132 { 00133 q = commandQueue; 00134 while ((r = q->next)) q = r; 00135 q->next = p; 00136 } 00137 #ifdef _MSC_VER 00138 if (IsToThePrompt ()) write_scilab ("\n"); 00139 #endif 00140 return (0); 00141 00142 break; 00143 } 00144 } 00145 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void SwitchConsole | ( | void | ) |
Definition at line 191 of file WinConsole.c.
References GetConsoleState(), HideScilex(), ScilexConsoleName, SetConsoleState(), and ShowScilex().
Referenced by Callback_CONSOLE(), ON_WND_CONSOLE_WM_SYSCOMMAND(), and ON_WND_TEXT_WM_KEY().
00192 { 00193 switch (GetConsoleState()) 00194 { 00195 /* La fenetre etait cachée , on la restaure */ 00196 case 0: 00197 { 00198 ShowScilex(); 00199 SetConsoleState(1); 00200 SetConsoleTitle(ScilexConsoleName); 00201 } 00202 break; 00203 /* La fenetre etait apparente , on la cache */ 00204 case 1: 00205 { 00206 HideScilex(); 00207 SetConsoleState(0); 00208 SetConsoleTitle(ScilexConsoleName); 00209 } 00210 break; 00211 } 00212 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void TextCopyClip | ( | LPTW | lptw | ) |
Definition at line 206 of file clipboard.c.
00207 { 00208 int size, count; 00209 HGLOBAL hGMem; 00210 LPSTR cbuf, cp; 00211 POINT pt, end; 00212 TEXTMETRIC tm; 00213 UINT type; 00214 HDC hdc; 00215 00216 if ((lptw->MarkBegin.x == lptw->MarkEnd.x) && 00217 (lptw->MarkBegin.y == lptw->MarkEnd.y) ) { 00218 /* copy user text */ 00219 return; 00220 } 00221 00222 size = (lptw->MarkEnd.y - lptw->MarkBegin.y + 1) 00223 * (lptw->ScreenSize.x + 2) + 1; 00224 hGMem = GlobalAlloc(GMEM_MOVEABLE, (DWORD)size); 00225 cbuf = cp = (LPSTR)GlobalLock(hGMem); 00226 if (cp == (LPSTR)NULL) 00227 return; 00228 00229 pt.x = lptw->MarkBegin.x; 00230 pt.y = lptw->MarkBegin.y; 00231 end.x = lptw->MarkEnd.x; 00232 end.y = lptw->MarkEnd.y; 00233 00234 while (pt.y < end.y) { 00235 /* copy to global buffer */ 00236 count = lptw->ScreenSize.x - pt.x; 00237 _fmemcpy(cp, lptw->ScreenBuffer + lptw->ScreenSize.x*pt.y+pt.x, count); 00238 /* remove trailing spaces */ 00239 for (count=count-1; count>=0; count--) { 00240 if (cp[count]!=' ') 00241 break; 00242 cp[count] = '\0'; 00243 } 00244 cp[++count] = '\r'; 00245 cp[++count] = '\n'; 00246 cp[++count] = '\0'; 00247 cp += count; 00248 pt.y++; 00249 pt.x=0; 00250 } 00251 /* partial line */ 00252 count = end.x - pt.x; 00253 if (end.y != lptw->ScreenSize.y) { 00254 _fmemcpy(cp, lptw->ScreenBuffer + lptw->ScreenSize.x*pt.y+pt.x, count); 00255 cp[count] = '\0'; 00256 } 00257 size = _fstrlen(cbuf) + 1; 00258 GlobalUnlock(hGMem); 00259 hGMem = GlobalReAlloc(hGMem, (DWORD)size, GMEM_MOVEABLE); 00260 /* find out what type to put into clipboard */ 00261 hdc = (HDC)TryToGetDC(lptw->hWndText); 00262 SelectObject(hdc, lptw->hfont); 00263 GetTextMetrics(hdc,(TEXTMETRIC FAR *)&tm); 00264 if (tm.tmCharSet == OEM_CHARSET) 00265 type = CF_OEMTEXT; 00266 else 00267 type = CF_TEXT; 00268 ReleaseDC(lptw->hWndText, hdc); 00269 /* give buffer to clipboard */ 00270 OpenClipboard(lptw->hWndParent); 00271 EmptyClipboard(); 00272 SetClipboardData(type, hGMem); 00273 CloseClipboard(); 00274 }
| void TextMakeFont | ( | LPTW | lptw | ) |
Definition at line 702 of file wtext.c.
Referenced by ON_WND_TEXT_WM_CREATE(), and TextSelectFont().
00703 { 00704 LOGFONT lf; 00705 TEXTMETRIC tm; 00706 LPSTR p; 00707 HDC hdc; 00708 00709 hdc = GetDC (lptw->hWndText); 00710 memset (&lf, 0, sizeof (LOGFONT)); 00711 strncpy (lf.lfFaceName, lptw->fontname, LF_FACESIZE); 00712 lf.lfHeight = -MulDiv (lptw->fontsize, GetDeviceCaps (hdc, LOGPIXELSY), 72); 00713 lf.lfPitchAndFamily = FIXED_PITCH; 00714 lf.lfCharSet = SCI_DEFAULT_CHARSET; 00715 if ((p = strstr (lptw->fontname, " Italic")) != (LPSTR) NULL) 00716 { 00717 lf.lfFaceName[(unsigned int) (p - lptw->fontname)] = '\0'; 00718 lf.lfItalic = TRUE; 00719 } 00720 if ((p = strstr (lptw->fontname, " Bold")) != (LPSTR) NULL) 00721 { 00722 lf.lfFaceName[(unsigned int) (p - lptw->fontname)] = '\0'; 00723 lf.lfWeight = FW_BOLD; 00724 } 00725 if (lptw->hfont != 0)DeleteFont (lptw->hfont); 00726 lptw->hfont = CreateFontIndirect ((LOGFONT FAR *) & lf); 00727 /* get text size */ 00728 SelectFont (hdc, lptw->hfont); 00729 GetTextMetrics (hdc, (TEXTMETRIC FAR *) & tm); 00730 lptw->CharSize.y = tm.tmHeight; 00731 lptw->CharSize.x = tm.tmAveCharWidth; 00732 lptw->CharAscent = tm.tmAscent; 00733 if (lptw->bFocus) CreateCaret (lptw->hWndText, 0, lptw->CharSize.x, 2 + lptw->CaretHeight); 00734 ReleaseDC (lptw->hWndText, hdc); 00735 return; 00736 }
Here is the caller graph for this function:

| void TextSelectFont | ( | LPTW | lptw | ) |
Definition at line 738 of file wtext.c.
00739 { 00740 LOGFONT lf; 00741 CHOOSEFONT cf; 00742 HDC hdc; 00743 char lpszStyle[LF_FACESIZE]; 00744 LPSTR p; 00745 /* Set all structure fields to zero. */ 00746 memset (&cf, 0, sizeof (CHOOSEFONT)); 00747 memset (&lf, 0, sizeof (LOGFONT)); 00748 cf.lStructSize = sizeof (CHOOSEFONT); 00749 cf.hwndOwner = lptw->hWndParent; 00750 strncpy (lf.lfFaceName, lptw->fontname, LF_FACESIZE); 00751 if ((p = strstr (lptw->fontname, " Bold")) != (LPSTR) NULL) 00752 { 00753 strncpy (lpszStyle, p + 1, LF_FACESIZE); 00754 lf.lfFaceName[(unsigned int) (p - lptw->fontname)] = '\0'; 00755 } 00756 else if ((p = strstr (lptw->fontname, " Italic")) != (LPSTR) NULL) 00757 { 00758 strncpy (lpszStyle, p + 1, LF_FACESIZE); 00759 lf.lfFaceName[(unsigned int) (p - lptw->fontname)] = '\0'; 00760 } 00761 else 00762 strcpy (lpszStyle, "Regular"); 00763 cf.lpszStyle = lpszStyle; 00764 hdc = GetDC (lptw->hWndText); 00765 lf.lfHeight = -MulDiv (lptw->fontsize, GetDeviceCaps (hdc, LOGPIXELSY), 72); 00766 ReleaseDC (lptw->hWndText, hdc); 00767 lf.lfPitchAndFamily = FIXED_PITCH; 00768 cf.lpLogFont = &lf; 00769 cf.nFontType = SCREEN_FONTTYPE; 00770 cf.Flags = CF_SCREENFONTS | CF_FIXEDPITCHONLY | CF_INITTOLOGFONTSTRUCT | CF_USESTYLE; 00771 if (ChooseFont (&cf)) 00772 { 00773 RECT rect; 00774 strcpy (lptw->fontname, lf.lfFaceName); 00775 lptw->fontsize = cf.iPointSize / 10; 00776 if (cf.nFontType & BOLD_FONTTYPE) 00777 lstrcat (lptw->fontname, " Bold"); 00778 if (cf.nFontType & ITALIC_FONTTYPE) 00779 lstrcat (lptw->fontname, " Italic"); 00780 TextMakeFont (lptw); 00781 /* force a window update */ 00782 GetClientRect (lptw->hWndText, (LPRECT) & rect); 00783 SendMessage (lptw->hWndText, WM_SIZE, SIZE_RESTORED, 00784 MAKELPARAM (rect.right - rect.left, rect.bottom - rect.top)); 00785 GetClientRect (lptw->hWndText, (LPRECT) & rect); 00786 InvalidateRect (lptw->hWndText, (LPRECT) & rect, 1); 00787 UpdateWindow (lptw->hWndText); 00788 } 00789 }
| 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 }
| HDC TryToGetDC | ( | HWND | hWnd | ) |
Definition at line 11 of file TryToGetDC.c.
00012 { 00013 HDC hDCRet=NULL; 00014 00015 if (hWnd) 00016 { 00017 hDCRet=GetDC(hWnd); 00018 if (hDCRet == NULL) 00019 { 00020 #ifdef _DEBUG 00021 MessageBox(NULL,MSG_ERROR36,MSG_ERROR20,MB_ICONWARNING); 00022 #endif 00023 } 00024 } 00025 else 00026 { 00027 #ifdef _DEBUG 00028 MessageBox(NULL,MSG_ERROR37,MSG_ERROR20,MB_ICONWARNING); 00029 #endif 00030 } 00031 00032 return (HDC)hDCRet; 00033 }
| void UpdateMark | ( | LPTW | lptw, | |
| POINT | pt | |||
| ) |
Definition at line 652 of file wtext.c.
Referenced by ON_WND_TEXT_WM_MOUSEMOVE().
00653 { 00654 int begin, point, end; 00655 LimitMark (lptw, &pt); 00656 begin = lptw->ScreenSize.x * lptw->MarkBegin.y + lptw->MarkBegin.x; 00657 point = lptw->ScreenSize.x * pt.y + pt.x; 00658 end = lptw->ScreenSize.x * lptw->MarkEnd.y + lptw->MarkEnd.x; 00659 00660 if (begin <= end) 00661 { 00662 /* forward mark */ 00663 if (point >= end) 00664 { 00665 /* extend marked area */ 00666 DoMark (lptw, lptw->MarkEnd, pt, TRUE); 00667 } 00668 else if (point >= begin) 00669 { 00670 /* retract marked area */ 00671 DoMark (lptw, pt, lptw->MarkEnd, FALSE); 00672 } 00673 else 00674 { /* retract and reverse */ 00675 DoMark (lptw, lptw->MarkBegin, lptw->MarkEnd, FALSE); 00676 DoMark (lptw, pt, lptw->MarkBegin, TRUE); 00677 } 00678 } 00679 else 00680 { 00681 /* reverse mark */ 00682 if (point <= end) 00683 { 00684 /* extend marked area */ 00685 DoMark (lptw, pt, lptw->MarkEnd, TRUE); 00686 } 00687 else if (point <= begin) 00688 { 00689 /* retract marked area */ 00690 DoMark (lptw, lptw->MarkEnd, pt, FALSE); 00691 } 00692 else 00693 { /* retract and reverse */ 00694 DoMark (lptw, lptw->MarkEnd, lptw->MarkBegin, FALSE); 00695 DoMark (lptw, lptw->MarkBegin, pt, TRUE); 00696 } 00697 } 00698 lptw->MarkEnd.x = pt.x; 00699 lptw->MarkEnd.y = pt.y; 00700 }
Here is the caller graph for this function:

| EXPORT LRESULT CALLBACK WndTextProc | ( | HWND | hwnd, | |
| UINT | message, | |||
| WPARAM | wParam, | |||
| LPARAM | lParam | |||
| ) |
Definition at line 84 of file WndConsoleTextProc.c.
References ON_WND_TEXT_WM_CHAR(), ON_WND_TEXT_WM_CLOSE(), ON_WND_TEXT_WM_COMMAND(), ON_WND_TEXT_WM_CREATE(), ON_WND_TEXT_WM_DESTROY(), ON_WND_TEXT_WM_HSCROLL(), ON_WND_TEXT_WM_KEY(), ON_WND_TEXT_WM_KILLFOCUS(), ON_WND_TEXT_WM_LBUTTONDOWN(), ON_WND_TEXT_WM_LBUTTONUP(), ON_WND_TEXT_WM_MBUTTONUP(), ON_WND_TEXT_WM_MOUSEMOVE(), ON_WND_TEXT_WM_MOUSEWHEEL(), ON_WND_TEXT_WM_PAINT(), ON_WND_TEXT_WM_RBUTTONDOWN(), ON_WND_TEXT_WM_SETCURSOR(), ON_WND_TEXT_WM_SETFOCUS(), ON_WND_TEXT_WM_SETTEXT(), ON_WND_TEXT_WM_SIZE(), ON_WND_TEXT_WM_SYSCOLORCHANGE(), ON_WND_TEXT_WM_VSCROLL(), and WM_MOUSEWHEEL.
Referenced by RegisterTextWindowClass().
00085 { 00086 switch (message) 00087 { 00088 HANDLE_MSG(hwnd,WM_SETCURSOR,ON_WND_TEXT_WM_SETCURSOR); 00089 HANDLE_MSG(hwnd,WM_SETFOCUS,ON_WND_TEXT_WM_SETFOCUS); 00090 HANDLE_MSG(hwnd,WM_KILLFOCUS,ON_WND_TEXT_WM_KILLFOCUS); 00091 HANDLE_MSG(hwnd,WM_SIZE,ON_WND_TEXT_WM_SIZE); 00092 HANDLE_MSG(hwnd,WM_MOUSEWHEEL,ON_WND_TEXT_WM_MOUSEWHEEL); 00093 HANDLE_MSG(hwnd,WM_HSCROLL,ON_WND_TEXT_WM_HSCROLL); 00094 HANDLE_MSG(hwnd,WM_VSCROLL,ON_WND_TEXT_WM_VSCROLL); 00095 HANDLE_MSG(hwnd,WM_KEYDOWN,ON_WND_TEXT_WM_KEY); 00096 HANDLE_MSG(hwnd,WM_RBUTTONDOWN,ON_WND_TEXT_WM_RBUTTONDOWN); 00097 HANDLE_MSG(hwnd,WM_MBUTTONUP,ON_WND_TEXT_WM_MBUTTONUP); 00098 HANDLE_MSG(hwnd,WM_LBUTTONDOWN,ON_WND_TEXT_WM_LBUTTONDOWN); 00099 HANDLE_MSG(hwnd,WM_LBUTTONUP,ON_WND_TEXT_WM_LBUTTONUP); 00100 HANDLE_MSG(hwnd,WM_MOUSEMOVE,ON_WND_TEXT_WM_MOUSEMOVE); 00101 HANDLE_MSG(hwnd,WM_SETTEXT,ON_WND_TEXT_WM_SETTEXT); 00102 HANDLE_MSG(hwnd,WM_COMMAND,ON_WND_TEXT_WM_COMMAND); 00103 HANDLE_MSG(hwnd,WM_SYSCOLORCHANGE,ON_WND_TEXT_WM_SYSCOLORCHANGE); 00104 HANDLE_MSG(hwnd,WM_PAINT,ON_WND_TEXT_WM_PAINT); 00105 HANDLE_MSG(hwnd,WM_CREATE,ON_WND_TEXT_WM_CREATE); 00106 HANDLE_MSG(hwnd,WM_DESTROY,ON_WND_TEXT_WM_DESTROY); 00107 HANDLE_MSG(hwnd,WM_CLOSE,ON_WND_TEXT_WM_CLOSE); 00108 HANDLE_MSG(hwnd,WM_CHAR,ON_WND_TEXT_WM_CHAR); 00109 } 00110 00111 return DefWindowProc (hwnd, message, wParam, lParam); 00112 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void WriteRegistryTxt | ( | LPTW | lptw | ) |
Definition at line 202 of file registry.c.
References tagTW::bSysColors, tagTW::fontname, tagTW::fontsize, GetIhmTextBackgroundColor(), GetIhmTextColor(), tagTW::hWndParent, tagTW::lpmw, MAX_PATH, NULL, result, SCI_VERSION_STRING, tagMW::ShowToolBar, and SW_SHOWNORMAL.
Referenced by ExitWindow(), ON_WND_CONSOLE_WM_EXITSIZEMOVE(), and ON_WND_TEXT_WM_COMMAND().
00203 { 00204 /* Modification Sauvegarde dans la base de registre dans 00205 HKEY_CURRENT_USER\\SOFTWARE\\Scilab\\"VERSION"\\Settings 00206 "Version" correspondant à la version de Scilab 00207 Sauvegarde dans HKEY_CURRENT_USER car données dépendant de l'utilisateur 00208 */ 00209 00210 HKEY key = NULL; 00211 DWORD result,dwsize=4; 00212 RECT rect; 00213 int iconic; 00214 char Clef[MAX_PATH]; 00215 int SizeX; 00216 int SizeY; 00217 int SysColors; 00218 DWORD TextColor; 00219 DWORD BackgroundColor; 00220 char TextFontName[MAX_PATH]; 00221 int TextFontSize; 00222 BOOL ShowButtons; 00223 // int LanguageCode; 00224 LONG TstRegCreateKeyEx=0; 00225 00226 wsprintf(Clef,"SOFTWARE\\Scilab\\%s\\Settings",SCI_VERSION_STRING); 00227 TstRegCreateKeyEx = RegCreateKeyEx(HKEY_CURRENT_USER, Clef, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &key, &result); 00228 if (TstRegCreateKeyEx == ERROR_SUCCESS) 00229 { 00230 iconic = IsIconic (lptw->hWndParent); 00231 if (iconic) ShowWindow (lptw->hWndParent, SW_SHOWNORMAL); 00232 00233 GetWindowRect (lptw->hWndParent, &rect); 00234 RegSetValueEx(key, "TextOriginX", 0, REG_DWORD, (LPBYTE)&rect.left, dwsize); 00235 RegSetValueEx(key, "TextOriginY", 0, REG_DWORD, (LPBYTE)&rect.top, dwsize); 00236 00237 SizeX=rect.right - rect.left; 00238 SizeY=rect.bottom - rect.top; 00239 RegSetValueEx(key, "TextSizeX", 0, REG_DWORD, (LPBYTE)&SizeX, dwsize); 00240 RegSetValueEx(key, "TextSizeY", 0, REG_DWORD, (LPBYTE)&SizeY, dwsize); 00241 00242 RegSetValueEx(key, "TextMinimized", 0, REG_DWORD, (LPBYTE)&iconic, dwsize); 00243 00244 strcpy(TextFontName,lptw->fontname); 00245 RegSetValueEx(key, "TextFontName", 0, REG_SZ, (LPBYTE)TextFontName, strlen(TextFontName)+1); 00246 00247 TextFontSize=lptw->fontsize; 00248 RegSetValueEx(key, "TextFontSize", 0, REG_DWORD, (LPBYTE)&TextFontSize, dwsize); 00249 00250 SysColors=lptw->bSysColors; 00251 RegSetValueEx(key, "SysColors", 0, REG_DWORD, (LPBYTE)&SysColors, dwsize); 00252 00253 TextColor=GetIhmTextColor(); 00254 RegSetValueEx(key, "TextColor", 0, REG_DWORD, (LPBYTE)&TextColor, dwsize); 00255 00256 BackgroundColor= GetIhmTextBackgroundColor(); 00257 RegSetValueEx(key, "BackgroundColor", 0, REG_DWORD, (LPBYTE)&BackgroundColor, dwsize); 00258 00259 ShowButtons=lptw->lpmw->ShowToolBar; 00260 RegSetValueEx(key, "ToolBar", 0, REG_DWORD, (LPBYTE)&ShowButtons, dwsize); 00261 00262 /*LanguageCode=lptw->lpmw->CodeLanguage; 00263 RegSetValueEx(key, "Language", 0, REG_DWORD, (LPBYTE)&LanguageCode, dwsize); 00264 */ 00265 00266 RegCloseKey(key); 00267 } 00268 00269 if (iconic) ShowWindow (lptw->hWndParent, SW_SHOWMINIMIZED); 00270 00271 }
Here is the call graph for this function:

Here is the caller graph for this function:

1.5.1