wtext.c File Reference

#include "WTEXT.h"
#include "wmcopydata.h"
#include "WinConsole.h"
#include "Messages.h"
#include "Warnings.h"
#include "Errors.h"
#include "WindowList.h"
#include "prompt.h"
#include "win_mem_alloc.h"

Include dependency graph for wtext.c:

Go to the source code of this file.

Defines

#define ScreenBufferSizeMaxY   25200
#define AddLines   360
#define RemoveLines   120
#define TEMPOTOUCHE   1

Functions

static void CreateTextClass (LPTW lptw)
static BOOL RegisterParentWindowClass (LPTW lptw)
static BOOL RegisterTextWindowClass (LPTW lptw)
int C2F() sciquit ()
void CreateThreadPaste (char *Text)
BOOL IsReadyForAnewLign (void)
void SetReadyOrNotForAnewLign (BOOL Ready)
HANDLE GetHandleThreadPaste (void)
BOOL GetThreadPasteRunning (void)
void SetThreadPasteRunning (BOOL Running)
void Kill_Scilex (void)
void SendCTRLandAKey (int code)
BOOL IsWindowInterface (void)
void ReplaceSlash (char *pathout, char *pathin)
BOOL IsAFile (char *chainefichier)
void ToolBarOnOff (LPTW lptw)
void ReLoadMenus (LPTW lptw)
DWORD GetIhmTextBackgroundColor (void)
void InitIhmDefaultColor (void)
DWORD GetIhmTextColor (void)
char * GetScilabDirectory (BOOL UnixStyle)
LPTW GetTextWinScilab (void)
void MessageBoxNewGraphicMode (void)
int GetLanguageCodeInScilabDotStar (void)
void ScilabFxFadeOut (void)
BOOL IsEnableTransparencyMode (void)
void C2F() tmpdirc (void)
EXPORT LRESULT CALLBACK WndParentProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
EXPORT LRESULT CALLBACK WndTextProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
EXPORT void WINAPI TextMessage (void)
EXPORT int WINAPI TextInit (LPTW lptw)
EXPORT void WINAPI TextClose (LPTW lptw)
EXPORT void WINAPI TextToCursor (LPTW lptw)
void NewLine (LPTW lptw)
void UpdateText (LPTW lptw, int count)
EXPORT int WINAPI TextPutCh (LPTW lptw, BYTE ch)
void TextPutStr (LPTW lptw, LPSTR str)
void LimitMark (LPTW lptw, POINT FAR *lppt)
void ClearMark (LPTW lptw, POINT pt)
void DoLine (LPTW lptw, HDC hdc, int xpos, int ypos, int offset, int count)
void DoMark (LPTW lptw, POINT pt, POINT end, BOOL mark)
void UpdateMark (LPTW lptw, POINT pt)
void TextMakeFont (LPTW lptw)
void TextSelectFont (LPTW lptw)
EXPORT int WINAPI TextKBHit (LPTW lptw)
EXPORT int WINAPI TextGetCh (LPTW lptw)
int CtrlCHit (LPTW lptw)
EXPORT int WINAPI TextGetChE (LPTW lptw)
EXPORT LPSTR WINAPI TextGetS (LPTW lptw, LPSTR str, unsigned int size)
EXPORT int WINAPI TextPutS (LPTW lptw, LPSTR str)
EXPORT void WINAPI TextGotoXY (LPTW lptw, int x, int y)
EXPORT int WINAPI TextWhereX (LPTW lptw)
EXPORT int WINAPI TextWhereY (LPTW lptw)
EXPORT void WINAPI TextCursorHeight (LPTW lptw, int height)
EXPORT void WINAPI TextClearEOL (LPTW lptw)
EXPORT void WINAPI TextClearEOS (LPTW lptw)
EXPORT void WINAPI TextInsertLine (LPTW lptw)
EXPORT void WINAPI TextDeleteLine (LPTW lptw)
EXPORT void WINAPI TextScrollReverse (LPTW lptw)
EXPORT void WINAPI TextAttr (LPTW lptw, BYTE attr)
void HelpOn (LPTW lptw)
void CutSelection (LPTW lptw)
void OnRightClickMenu (LPTW lptw)
void EvaluateSelection (LPTW lptw)
void OpenSelection (LPTW lptw)
BOOL HasAZoneTextSelected (LPTW lptw)
void ClearLinesScreenConsole (int NbrOfLines)
void ClearCommandWindow (LPTW lptw, BOOL Clearfirstline)
void InitScreenBuffer (LPTW lptw)
void ForceToActiveWindowParent (void)
void CleanPromptFromText (char *Text)
int ReplacePrompt (char *Text, char *prompt)
void ResizeScreenBuffer (LPTW lptw)
void ReAllocScreenBuffer (LPTW lptw)
void ReorganizeScreenBuffer (LPTW lptw)
void ExitWindow (void)
void write_scilab_synchro (char *line)
DWORD WINAPI WriteTextThread (LPVOID lpParam)
void InvalidateCursor (void)
void SelectAll (LPTW lptw, BOOL DoAMark)
void UnSelect (LPTW lptw)
BOOL WriteIntoScilab (LPTW lptw, char *StringCommand)
void WriteIntoKeyBuffer (LPTW lptw, char *StringCommand)
BOOL IsToThePrompt (void)
void EnableNMenus (LPTW lptw, int numbermenus)
void EnableMenus (LPTW lptw)
void DisableMenus (LPTW lptw)
int GetCurrentLanguage (void)

Variables

BOOL ConsoleIsMinimized = FALSE
static BOOL WriteInKeyBuf = FALSE
char ScilexWindowName [MAX_PATH]
POINT ScreenMinSize = {16, 4}
POINT ScrollSize = {80,360}
char szNoMemory [] = "out of memory"
HANDLE hThreadWrite
CRITICAL_SECTION Sync
HINSTANCE hdllInstance
LPSTR szParentClass = "wscilab_parent"
LPSTR szTextClass = "wscilab_text"


Define Documentation

#define AddLines   360

Referenced by ReAllocScreenBuffer().

#define RemoveLines   120

Referenced by ReorganizeScreenBuffer().

#define ScreenBufferSizeMaxY   25200

Referenced by ResizeScreenBuffer().

#define TEMPOTOUCHE   1


Function Documentation

void CleanPromptFromText ( char *  Text  ) 

Definition at line 1516 of file wtext.c.

References FREE, i, MALLOC, NULL, prompt, ReplacePrompt(), SCIPROMPT, SCIPROMPT_INTERRUPT, and SCIPROMPT_PAUSE.

01517 {
01518         char *CleanText=NULL;
01519         
01520         char prompt[6];
01521 
01522         int LenText=0;
01523         int i=0;
01524         
01525         LenText=strlen(Text)+1;
01526         CleanText=(char*)MALLOC(LenText*sizeof(char));
01527         strcpy(CleanText,Text);
01528         
01529         strcpy(prompt,SCIPROMPT);
01530         ReplacePrompt(CleanText,prompt);
01531         
01532         strcpy(prompt,SCIPROMPT_PAUSE);
01533         ReplacePrompt(CleanText,prompt);
01534         
01535 
01536         for (i=1;i<127;i++)
01537         {
01538                 char TmpPrompt[6];
01539                 wsprintf(TmpPrompt,SCIPROMPT_INTERRUPT,i);
01540                 ReplacePrompt(CleanText,TmpPrompt);
01541                 strcpy(TmpPrompt," ");
01542         }
01543         
01544         strcpy(Text,CleanText);
01545         
01546         FREE(CleanText);
01547 }

Here is the call graph for this function:

void ClearCommandWindow ( LPTW  lptw,
BOOL  Clearfirstline 
)

Definition at line 1416 of file wtext.c.

References tagTW::CharSize, ClearMark(), CTRLU, FALSE, HasAZoneTextSelected(), tagTW::hWndText, InitScreenBuffer(), tagTW::Marking, NULL, pt, SB_HORZ, SB_VERT, tagTW::ScreenBuffer, tagTW::ScreenSize, tagTW::ScrollPos, SendCTRLandAKey(), TextGotoXY(), and TRUE.

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 }

Here is the call graph for this function:

void ClearLinesScreenConsole ( int  NbrOfLines  ) 

Definition at line 1388 of file wtext.c.

References tagTW::AttrBuffer, tagTW::CursorPos, GetTextWinScilab(), tagTW::hWndText, i, IsWindowInterface(), MSG_WARNING28, NOTEXT, NULL, sciprint(), tagTW::ScreenBuffer, tagTW::ScreenSize, TextGotoXY(), TRUE, and X.

Referenced by sci_clc().

01389 {
01390         if (IsWindowInterface())
01391         {
01392                 int X=0,Y=0;
01393                 int i = 0;
01394                 LPTW lptw=GetTextWinScilab();
01395 
01396                 X=lptw->CursorPos.x;
01397                 Y=lptw->CursorPos.y-NbrOfLines;
01398                 if (Y>0)
01399                 {
01400                         i=(Y)*lptw->ScreenSize.x;
01401 
01402                         _fmemset(lptw->ScreenBuffer + i, ' ', (NbrOfLines+1)*lptw->ScreenSize.x);
01403                         _fmemset(lptw->AttrBuffer + i, NOTEXT, (NbrOfLines+1)*lptw->ScreenSize.x);
01404 
01405                         TextGotoXY (lptw, X,Y);
01406                         InvalidateRect (lptw->hWndText, NULL, TRUE);
01407                 }
01408                 else
01409                 {
01410                         sciprint(MSG_WARNING28);
01411                 }
01412         }
01413 }

Here is the call graph for this function:

Here is the caller graph for this function:

void ClearMark ( LPTW  lptw,
POINT  pt 
)

Definition at line 524 of file wtext.c.

References tagTW::CharSize, tagTW::hWndText, LimitMark(), tagTW::MarkBegin, tagTW::MarkEnd, tagTW::ScreenSize, tagTW::ScrollPos, and TRUE.

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 call graph for this function:

static void CreateTextClass ( LPTW  lptw  )  [static]

Definition at line 172 of file wtext.c.

References RegisterParentWindowClass(), and RegisterTextWindowClass().

Referenced by TextInit().

00173 {       
00174         if (!RegisterParentWindowClass (lptw)) exit(1);
00175         if (!RegisterTextWindowClass (lptw)) exit(1);
00176 }

Here is the call graph for this function:

Here is the caller graph for this function:

void CreateThreadPaste ( char *  Text  ) 

Definition at line 28 of file clipboard.c.

References hThreadPaste, MALLOC, NULL, PasteForThread, and SendInputText().

Referenced by ON_WND_TEXT_WM_SETTEXT().

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 }

Here is the call graph for this function:

Here is the caller graph for this function:

int CtrlCHit ( LPTW  lptw  ) 

Definition at line 867 of file wtext.c.

References HasAZoneTextSelected(), SignalCtrC(), TextCopyClip(), and TextKBHit().

00868 {
00869   int ch;
00870   
00871   if (TextKBHit (lptw))
00872     {
00873       ch = *lptw->KeyBufOut++;
00874       if (lptw->KeyBufOut - lptw->KeyBuf >= (int) lptw->KeyBufSize)
00875         lptw->KeyBufOut = lptw->KeyBuf;         /* wrap around */
00876       if (ch == 3)
00877         {
00878         
00879           if ( HasAZoneTextSelected(lptw) )
00880           {
00881                 TextCopyClip(lptw);
00882           }
00883           else
00884           {
00885                 SignalCtrC ();
00886           }
00887           
00888           
00889           return (1);
00890         }
00891     }
00892   return (0);
00893 }

Here is the call graph for this function:

void CutSelection ( LPTW  lptw  ) 

Definition at line 1156 of file wtext.c.

01157 {
01158 }

void DisableMenus ( LPTW  lptw  ) 

Definition at line 2001 of file wtext.c.

References tagMW::hMenu, tagTW::hWndParent, i, and tagTW::lpmw.

Referenced by TextInit().

02002 {
02003   int i=0;
02004   int Nums = GetMenuItemCount (lptw->lpmw->hMenu);
02005 
02006   for(i=0;i<Nums;i++)
02007   {
02008           EnableMenuItem (lptw->lpmw->hMenu, i, MF_GRAYED| MF_BYPOSITION);
02009   }
02010   DrawMenuBar(lptw->hWndParent); 
02011 }

Here is the caller graph for this function:

void DoLine ( LPTW  lptw,
HDC  hdc,
int  xpos,
int  ypos,
int  offset,
int  count 
)

Definition at line 577 of file wtext.c.

References tagTW::AttrBuffer, tagTW::CharSize, GetIhmTextBackgroundColor(), GetIhmTextColor(), MSG_ERROR56, NULL, num, tagTW::ScreenBuffer, and tagTW::ScreenSize.

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 call graph for this function:

void DoMark ( LPTW  lptw,
POINT  pt,
POINT  end,
BOOL  mark 
)

Definition at line 606 of file wtext.c.

References tagTW::CharSize, count, DoLine(), hdc, tagTW::hfont, tagTW::hWndText, offset, tagTW::ScreenBuffer, tagTW::ScreenSize, tagTW::ScrollPos, and void().

Referenced by SelectAll(), and UpdateMark().

00607 {
00608   int xpos, ypos;
00609   HDC hdc;
00610   int count;
00611   int offset;
00612   offset = lptw->ScreenSize.x * pt.y + pt.x;
00613   hdc = GetDC (lptw->hWndText);
00614   SelectFont (hdc, lptw->hfont);
00615 
00616   SetTextColor (hdc, GetSysColor (COLOR_HIGHLIGHTTEXT));
00617   SetBkColor (hdc, GetSysColor (COLOR_HIGHLIGHT));
00618 
00619   while (pt.y < end.y)
00620     {
00621       /* multiple lines */
00622       xpos = pt.x * lptw->CharSize.x - lptw->ScrollPos.x;
00623       ypos = pt.y * lptw->CharSize.y - lptw->ScrollPos.y;
00624       count = lptw->ScreenSize.x - pt.x;
00625       if (mark)
00626         TextOut (hdc, xpos, ypos, (LPSTR) (lptw->ScreenBuffer + offset), count);
00627       else
00628         {
00629           DoLine (lptw, hdc, xpos, ypos, offset, count);
00630 
00631           SetTextColor (hdc, GetSysColor (COLOR_HIGHLIGHTTEXT));
00632           SetBkColor (hdc, GetSysColor (COLOR_HIGHLIGHT));
00633         }
00634       offset += count;
00635       pt.y++;
00636       pt.x = 0;
00637     }
00638   /* partial line */
00639   xpos = pt.x * lptw->CharSize.x - lptw->ScrollPos.x;
00640   ypos = pt.y * lptw->CharSize.y - lptw->ScrollPos.y;
00641   count = end.x - pt.x;
00642   if (end.y != lptw->ScreenSize.y)
00643     {
00644       if (mark)
00645         TextOut (hdc, xpos, ypos, (LPSTR) (lptw->ScreenBuffer + offset), count);
00646       else
00647         DoLine (lptw, hdc, xpos, ypos, offset, count);
00648     }
00649   (void) ReleaseDC (lptw->hWndText, hdc);
00650 }

Here is the call graph for this function:

Here is the caller graph for this function:

void EnableMenus ( LPTW  lptw  ) 

Definition at line 1995 of file wtext.c.

References EnableNMenus(), tagMW::hMenu, and tagTW::lpmw.

01996 {
01997   int Nums = GetMenuItemCount (lptw->lpmw->hMenu);
01998   EnableNMenus(lptw,Nums);
01999 }

Here is the call graph for this function:

void EnableNMenus ( LPTW  lptw,
int  numbermenus 
)

Definition at line 1985 of file wtext.c.

References tagMW::hMenu, tagTW::hWndParent, i, and tagTW::lpmw.

Referenced by ChangeCursorWhenScilabIsReady(), and EnableMenus().

01986 {
01987   int i=0;
01988   for(i=0;i<numbermenus;i++)
01989   {
01990           EnableMenuItem (lptw->lpmw->hMenu, i, MF_ENABLED| MF_BYPOSITION);
01991   }
01992   DrawMenuBar(lptw->hWndParent);        
01993 }

Here is the caller graph for this function:

void EvaluateSelection ( LPTW  lptw  ) 

Definition at line 1206 of file wtext.c.

References hdc, tagTW::hfont, tagTW::hWndText, i, l, MALLOC, NULL, TextCopyClip(), TEXTMETRIC, type, UINT, and write_scilab_synchro().

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 call graph for this function:

void ExitWindow ( void   ) 

Definition at line 1736 of file wtext.c.

References tagTW::bGetCh, C2F, tagMW::CodeLanguage, FALSE, get_is_reading(), GetHandleThreadPaste(), GetTextWinScilab(), GetThreadPasteRunning(), tagTW::hWndParent, IsEnableTransparencyMode(), tagTW::lpmw, Message(), MSG_SCIMSG83, MSG_SCIMSG84, MSG_SCIMSG85, MSG_SCIMSG86, ScilabFxFadeOut(), sciquit(), SetThreadPasteRunning(), and WriteRegistryTxt().

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 call graph for this function:

void ForceToActiveWindowParent ( void   ) 

Definition at line 1498 of file wtext.c.

References GetTextWinScilab(), and tagTW::hWndParent.

Referenced by sci_raise_window(), and Windows_Main().

01499 {
01500         LPTW lptw=GetTextWinScilab();
01501         
01502         while (GetForegroundWindow()!= lptw->hWndParent)
01503         {
01504                 SetForegroundWindow(lptw->hWndParent);
01505                 SetActiveWindow(lptw->hWndParent);
01506                 Sleep(1);
01507         }
01508 }

Here is the call graph for this function:

Here is the caller graph for this function:

int GetCurrentLanguage ( void   ) 

Definition at line 2013 of file wtext.c.

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

02014 {
02015         int ReturnLanguage=0;
02016 
02017         if (IsWindowInterface())
02018         {
02019                 LPTW lptw=GetTextWinScilab();
02020                 int IHMLanguage=lptw->lpmw->CodeLanguage;
02021                 ReturnLanguage=IHMLanguage;
02022         }
02023         else
02024         {
02025                 int SCILanguague=GetLanguageCodeInScilabDotStar();
02026                 ReturnLanguage=SCILanguague;
02027         }
02028         
02029         return ReturnLanguage;
02030 }

Here is the call graph for this function:

HANDLE GetHandleThreadPaste ( void   ) 

Definition at line 291 of file clipboard.c.

References hThreadPaste.

Referenced by ExitWindow().

00292 {
00293         return hThreadPaste;
00294 }

Here is the caller graph for this function:

DWORD GetIhmTextBackgroundColor ( void   ) 

Definition at line 106 of file ihmcolor.c.

References CurrentIHMTextBackgroundColor.

Referenced by Callback_BACKGROUNDCOLOR(), DoLine(), RegisterParentWindowClass(), RegisterTextWindowClass(), TextClearEOL(), UpdateText(), and WriteRegistryTxt().

00107 {
00108         return CurrentIHMTextBackgroundColor;
00109 }

Here is the caller graph for this function:

DWORD GetIhmTextColor ( void   ) 

Definition at line 101 of file ihmcolor.c.

References CurrentIHMTextColor.

Referenced by Callback_TEXTCOLOR(), DoLine(), TextClearEOL(), UpdateText(), and WriteRegistryTxt().

00102 {
00103         return CurrentIHMTextColor;
00104 }

Here is the caller graph for this function:

int GetLanguageCodeInScilabDotStar ( void   ) 

Definition at line 2020 of file wmenu.c.

References ConvertPathUnixToWindowsFormat(), FREE, getSCIpath(), i, int, j, MAX_PATH, MOTCLEF, and SCILABSTAR.

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 }

Here is the call graph for this function:

char* GetScilabDirectory ( BOOL  UnixStyle  ) 

Definition at line 64 of file SciEnv.c.

00065 {
00066         LPSTR ScilabModuleName=NULL;
00067         char drive[_MAX_DRIVE];
00068         char dir[_MAX_DIR];
00069         char fname[_MAX_FNAME];
00070         char ext[_MAX_EXT];
00071 
00072         char *SciPathName=NULL;
00073         char *DirTmp=NULL;
00074 
00075         ScilabModuleName = (LPSTR) MALLOC (MAXSTR + 1);
00076 
00077         if (!GetModuleFileName ((HINSTANCE)GetModuleHandle(MSG_SCIMSG9), (LPSTR) ScilabModuleName, MAXSTR))
00078         {
00079                 if (ScilabModuleName) {FREE(ScilabModuleName);ScilabModuleName=NULL;}
00080                 return NULL;
00081         }
00082 
00083         _splitpath(ScilabModuleName,drive,dir,fname,ext);
00084         if (ScilabModuleName) {FREE(ScilabModuleName);ScilabModuleName=NULL;}
00085         if (dir[strlen(dir)-1] == '\\') dir[strlen(dir)-1] = '\0';
00086 
00087         DirTmp=strrchr (dir, '\\');
00088         if (strlen(dir)-strlen(DirTmp)>0)
00089         {
00090                 dir[strlen(dir)-strlen(DirTmp)] = '\0';
00091         }
00092         else return NULL;
00093 
00094         SciPathName=(char*)MALLOC((int)(strlen(drive)+strlen(dir)+5)*sizeof(char));
00095         
00096         _makepath(SciPathName,drive,dir,NULL,NULL);
00097 
00098         if ( UnixStyle )
00099         {       
00100                 int i=0;
00101                 for (i=0;i<(int)strlen(SciPathName);i++)
00102                 {
00103                         if (SciPathName[i]=='\\') SciPathName[i]='/';
00104                 }
00105         }
00106         SciPathName[strlen(SciPathName)-1]='\0';
00107         setSCIpath(SciPathName);
00108         return SciPathName;
00109 }

LPTW GetTextWinScilab ( void   ) 

Definition at line 10 of file TextWindows.c.

00011 {
00012         return &textwin;
00013 }

BOOL GetThreadPasteRunning ( void   ) 

Definition at line 296 of file clipboard.c.

References ThreadPasteRunning.

Referenced by ExitWindow(), and TextGetCh().

00297 {
00298         return ThreadPasteRunning;
00299 }

Here is the caller graph for this function:

BOOL HasAZoneTextSelected ( LPTW  lptw  ) 

Definition at line 1377 of file wtext.c.

References FALSE, tagTW::MarkBegin, tagTW::MarkEnd, tagTW::ScreenSize, and TRUE.

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 }

void HelpOn ( LPTW  lptw  ) 

Definition at line 1077 of file wtext.c.

References FREE, hdc, tagTW::hfont, tagTW::hWndText, i, l, MALLOC, MAX_PATH, NULL, StoreCommand1(), TextCopyClip(), TEXTMETRIC, type, and UINT.

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 call graph for this function:

void InitIhmDefaultColor ( void   ) 

Definition at line 111 of file ihmcolor.c.

References CurrentIHMTextBackgroundColor, and CurrentIHMTextColor.

Referenced by ON_WND_CONSOLE_WM_SYSCOLORCHANGE(), ON_WND_TEXT_WM_SYSCOLORCHANGE(), and TextInit().

00112 {
00113         CurrentIHMTextColor=GetSysColor(COLOR_WINDOWTEXT);
00114         CurrentIHMTextBackgroundColor=GetSysColor(COLOR_WINDOW);
00115 }

Here is the caller graph for this function:

void InitScreenBuffer ( LPTW  lptw  ) 

Definition at line 1447 of file wtext.c.

References tagTW::AttrBuffer, tagTW::CharSize, tagTW::ClientSize, FALSE, tagTW::hWndText, max, min, NOTEXT, NULL, SB_VERT, tagTW::ScreenBuffer, tagTW::ScreenSize, tagTW::ScrollMax, tagTW::ScrollPos, szNoMemory, and TRUE.

Referenced by ClearCommandWindow().

01448 {
01449         HGLOBAL hglobal;
01450         
01451         /* Destruction du Screenbuffer */
01452         hglobal = GlobalHandle (lptw->ScreenBuffer);
01453         if (hglobal)
01454         {
01455                 GlobalUnlock (hglobal);
01456                 GlobalFree (hglobal);
01457         }
01458         
01459         hglobal = GlobalHandle (lptw->AttrBuffer);
01460         if (hglobal)
01461         {
01462                 GlobalUnlock (hglobal);
01463                 GlobalFree (hglobal);
01464         }
01465         
01466         /* Réinitialisation des dimensions */
01467         /*lptw->ScreenSize.x = ScrollSize.x; / * 80 par défaut*/
01468         /*lptw->ScreenSize.y = ScrollSize.y; / * 360 par défaut*/
01469         
01470         lptw->ScrollMax.y = max (0, lptw->CharSize.y * lptw->ScreenSize.y - lptw->ClientSize.y);
01471         lptw->ScrollPos.y = min (lptw->ScrollPos.y, lptw->ScrollMax.y);
01472 
01473         /* Allocation Memoire ScreenBuffer */   
01474         hglobal = GlobalAlloc (GHND, lptw->ScreenSize.x * lptw->ScreenSize.y);
01475 
01476         lptw->ScreenBuffer = (BYTE FAR *) GlobalLock (hglobal);
01477         if (lptw->ScreenBuffer == (BYTE FAR *) NULL)
01478         {
01479                 MessageBox ((HWND) NULL, szNoMemory, (LPSTR) NULL, MB_ICONHAND | MB_SYSTEMMODAL);
01480                 exit(1);
01481         }
01482         _fmemset (lptw->ScreenBuffer, ' ', lptw->ScreenSize.x * lptw->ScreenSize.y);
01483                 
01484         hglobal = GlobalAlloc (GHND, lptw->ScreenSize.x * lptw->ScreenSize.y);
01485         lptw->AttrBuffer = (BYTE FAR *) GlobalLock (hglobal);
01486         if (lptw->AttrBuffer == (BYTE FAR *) NULL)
01487         {
01488                 MessageBox ((HWND) NULL, szNoMemory, (LPSTR) NULL, MB_ICONHAND | MB_SYSTEMMODAL);
01489                 exit(1);
01490         }
01491         _fmemset (lptw->AttrBuffer, NOTEXT, lptw->ScreenSize.x * lptw->ScreenSize.y);
01492         
01493         SetScrollRange (lptw->hWndText, SB_VERT, 0, lptw->ScrollMax.y, FALSE);
01494         SetScrollPos (lptw->hWndText, SB_VERT, lptw->ScrollPos.y, TRUE);
01495         UpdateWindow (lptw->hWndText);
01496 }

Here is the caller graph for this function:

void InvalidateCursor ( void   ) 

Definition at line 1841 of file wtext.c.

References pt.

Referenced by ChangeCursorWhenScilabIsReady().

01842 {
01843         POINT pt; // Screen coordinates!
01844         GetCursorPos( &pt );
01845         SetCursorPos( pt.x, pt.y );
01846 }

Here is the caller graph for this function:

BOOL IsAFile ( char *  chainefichier  ) 

Definition at line 17 of file FilesAssociations.c.

References FALSE, and TRUE.

Referenced by CommandByFileExtension(), CreateButton(), and OpenSelection().

00018 {
00019      BOOL retour=FALSE; 
00020         
00021      WIN32_FIND_DATA FindFileData;
00022      HANDLE handle = FindFirstFile (chainefichier, &FindFileData);
00023      if (handle != INVALID_HANDLE_VALUE)
00024      {
00025          FindClose (handle);
00026          retour=TRUE;
00027      }
00028      else retour=FALSE;
00029 
00030      return retour;
00031 }

Here is the caller graph for this function:

BOOL IsEnableTransparencyMode ( void   ) 

Definition at line 24 of file Transparency.c.

References TransparencyON.

Referenced by ExitWindow(), and ON_WND_TEXT_WM_KEY().

00025 {
00026         return TransparencyON;
00027 }

Here is the caller graph for this function:

BOOL IsReadyForAnewLign ( void   ) 

Definition at line 39 of file clipboard.c.

References ReadyForAnewLign.

Referenced by SendInputText().

00040 {
00041         return ReadyForAnewLign;
00042 }

Here is the caller graph for this function:

BOOL IsToThePrompt ( void   ) 

Definition at line 1974 of file wtext.c.

References tagTW::bGetCh, C2F, FALSE, get_is_reading(), GetTextWinScilab(), ismenu(), and TRUE.

01975 {
01976         BOOL retour=FALSE;
01977         LPTW lptw=GetTextWinScilab();
01978 
01979         if  (( ( C2F (ismenu) () == 1 ) || ( lptw->bGetCh == FALSE ) ) && (!get_is_reading()) ) retour=FALSE;
01980         else retour=TRUE;
01981 
01982         return retour;
01983 }

Here is the call graph for this function:

BOOL IsWindowInterface ( void   ) 

Definition at line 127 of file WinConsole.c.

00128 {
00129         return WindowMode;
00130 }

void Kill_Scilex ( void   ) 

Definition at line 575 of file winmain.c.

References FALSE, MSG_WARNING20, MSG_WARNING21, and NULL.

00576 {
00577         HANDLE hProcess;
00578         /* Ouverture de ce Process avec droit pour le tuer */
00579 
00580         hProcess=OpenProcess(PROCESS_TERMINATE,FALSE,GetCurrentProcessId());
00581         if (hProcess)
00582         {
00583                 /* Tue ce Process */
00584 
00585                 TerminateProcess(hProcess,0);
00586         }
00587         else MessageBox(NULL,MSG_WARNING20,MSG_WARNING21,MB_ICONWARNING);
00588 }

void LimitMark ( LPTW  lptw,
POINT FAR *  lppt 
)

Definition at line 506 of file wtext.c.

References tagTW::ScreenSize.

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 }

void MessageBoxNewGraphicMode ( void   ) 

Definition at line 17 of file MessageBoxNewGraphicMode.c.

References hdllInstance, MAX_PATH, MessageBoxNewGraphicModeDlgProc(), NULL, result, SCI_VERSION_STRING, and size.

Referenced by Windows_Main().

00018 {
00019         HKEY key;
00020         DWORD result,size=4;
00021         char Clef[MAX_PATH];
00022         int DontShowMessageNewGraphicMode,Ans;
00023 
00024         wsprintf(Clef,"SOFTWARE\\Scilab\\%s\\Settings",SCI_VERSION_STRING);
00025   result=RegOpenKeyEx(HKEY_CURRENT_USER, Clef, 0, KEY_QUERY_VALUE , &key);
00026 
00027         if ( RegQueryValueEx(key, "DontShowMessageNewGraphicMode", 0, NULL, (LPBYTE)&Ans, &size) !=  ERROR_SUCCESS )
00028   {
00029         DontShowMessageNewGraphicMode = 0;
00030         }
00031         else
00032         {
00033                 DontShowMessageNewGraphicMode = Ans;
00034         }
00035 
00036         if ( result == ERROR_SUCCESS ) RegCloseKey(key);
00037 
00038         if (DontShowMessageNewGraphicMode == 0)
00039         {
00040                 DialogBox(hdllInstance, "IDD_MESSAGE_NEW_GRAPHIC", NULL,MessageBoxNewGraphicModeDlgProc);
00041         }
00042 }

Here is the call graph for this function:

Here is the caller graph for this function:

void NewLine ( LPTW  lptw  ) 

Definition at line 359 of file wtext.c.

References tagTW::AttrBuffer, tagTW::CharSize, tagTW::CursorFlag, tagTW::CursorPos, tagTW::hWndText, i, LimitMark(), tagTW::MarkBegin, tagTW::MarkEnd, NOTEXT, NULL, tagTW::ScreenBuffer, tagTW::ScreenSize, and TextToCursor().

00360 {
00361         lptw->CursorPos.x = 0;
00362         lptw->CursorPos.y++;
00363         if (lptw->CursorPos.y >= lptw->ScreenSize.y) {
00364             int i =  lptw->ScreenSize.x * (lptw->ScreenSize.y - 1);
00365                 _fmemmove(lptw->ScreenBuffer, lptw->ScreenBuffer+lptw->ScreenSize.x, i);
00366                 _fmemset(lptw->ScreenBuffer + i, ' ', lptw->ScreenSize.x);
00367                 _fmemmove(lptw->AttrBuffer, lptw->AttrBuffer+lptw->ScreenSize.x, i);
00368                 _fmemset(lptw->AttrBuffer + i, NOTEXT, lptw->ScreenSize.x);
00369                 lptw->CursorPos.y--;
00370                 ScrollWindow(lptw->hWndText,0,-lptw->CharSize.y,NULL,NULL);
00371                 lptw->MarkBegin.y--;
00372                 lptw->MarkEnd.y--;
00373                 LimitMark(lptw, &lptw->MarkBegin);
00374                 LimitMark(lptw, &lptw->MarkEnd);
00375                 UpdateWindow(lptw->hWndText);
00376         }
00377         if (lptw->CursorFlag) TextToCursor(lptw);
00378         
00379 }

Here is the call graph for this function:

void OnRightClickMenu ( LPTW  lptw  ) 

Definition at line 1160 of file wtext.c.

References tagMW::CodeLanguage, tagTW::hPopMenu, tagTW::hWndText, tagTW::lpmw, M_COPY_CLIP, M_EVALSELECTION, M_HELPON, M_OPENSELECTION, M_PASTE, M_PRINTSELECTION, M_SELECT_ALL, MF_SEPARATOR, MSG_SCIMSG67, MSG_SCIMSG68, MSG_SCIMSG69, MSG_SCIMSG70, MSG_SCIMSG71, MSG_SCIMSG72, MSG_SCIMSG73, MSG_SCIMSG74, MSG_SCIMSG75, MSG_SCIMSG76, MSG_SCIMSG77, MSG_SCIMSG78, MSG_SCIMSG79, MSG_SCIMSG80, and NULL.

Referenced by SwitchLanguage(), and TextInit().

01162 {
01163   /* Modification Allan CORNET */
01164    
01165   if (lptw->hPopMenu) DestroyMenu(lptw->hPopMenu);      
01166   lptw->hPopMenu = CreatePopupMenu ();
01167   
01168   switch (lptw->lpmw->CodeLanguage)
01169   {
01170         case 1: /* French */
01171         {
01172                 /*AppendMenu (lptw->hPopMenu, MF_STRING|MF_GRAYED, M_CUT, "&Couper      Ctrl+X");*/
01173                 AppendMenu (lptw->hPopMenu, MF_STRING|MF_ENABLED, M_SELECT_ALL, MSG_SCIMSG67);
01174                 AppendMenu (lptw->hPopMenu, MF_SEPARATOR, 0, NULL);
01175                 AppendMenu (lptw->hPopMenu, MF_STRING|MF_GRAYED, M_COPY_CLIP, MSG_SCIMSG68);
01176                 AppendMenu (lptw->hPopMenu, MF_STRING|MF_GRAYED, M_PASTE, MSG_SCIMSG69);
01177                 //AppendMenu (lptw->hPopMenu, MF_STRING|MF_GRAYED, M_SPECIALPASTE, "Coller &Special     Shft+V");
01178                 AppendMenu (lptw->hPopMenu, MF_STRING|MF_GRAYED,M_PRINTSELECTION, MSG_SCIMSG70);
01179                 AppendMenu (lptw->hPopMenu, MF_SEPARATOR, 0, NULL);
01180                 AppendMenu (lptw->hPopMenu, MF_STRING|MF_GRAYED,M_EVALSELECTION, MSG_SCIMSG71);
01181                 AppendMenu (lptw->hPopMenu, MF_STRING|MF_GRAYED,M_OPENSELECTION, MSG_SCIMSG72);
01182                 AppendMenu (lptw->hPopMenu, MF_STRING|MF_GRAYED,M_HELPON, MSG_SCIMSG73);
01183         }
01184         break;
01185         default: case 0: /*English */
01186         {
01187                 /*AppendMenu (lptw->hPopMenu, MF_STRING|MF_GRAYED, M_CUT, "C&ut Ctrl+X");*/
01188                 AppendMenu (lptw->hPopMenu, MF_STRING|MF_ENABLED, M_SELECT_ALL, MSG_SCIMSG74);
01189                 AppendMenu (lptw->hPopMenu, MF_SEPARATOR, 0, NULL);
01190                 AppendMenu (lptw->hPopMenu, MF_STRING|MF_GRAYED, M_COPY_CLIP, MSG_SCIMSG75);
01191                 AppendMenu (lptw->hPopMenu, MF_STRING|MF_GRAYED, M_PASTE, MSG_SCIMSG76);
01192                 //AppendMenu (lptw->hPopMenu, MF_STRING|MF_GRAYED, M_SPECIALPASTE, "&Special Paste      Shft+V");
01193                 AppendMenu (lptw->hPopMenu, MF_STRING|MF_GRAYED,M_PRINTSELECTION, MSG_SCIMSG77);
01194                 AppendMenu (lptw->hPopMenu, MF_SEPARATOR, 0, NULL);
01195                 AppendMenu (lptw->hPopMenu, MF_STRING|MF_GRAYED,M_EVALSELECTION, MSG_SCIMSG78);
01196                 AppendMenu (lptw->hPopMenu, MF_STRING|MF_GRAYED,M_OPENSELECTION, MSG_SCIMSG79);
01197                 AppendMenu (lptw->hPopMenu, MF_STRING|MF_GRAYED,M_HELPON, MSG_SCIMSG80);
01198 
01199         }
01200         break;
01201   }
01202         SendMessage (lptw->hWndText, WM_LBUTTONUP,0, 0);  
01203         
01204 }

Here is the caller graph for this function:

void OpenSelection ( LPTW  lptw  ) 

Definition at line 1249 of file wtext.c.

References CTRLL, hdc, tagTW::hfont, tagTW::hWndText, i, IsAFile(), l, MALLOC, MAX_PATH, Message(), MSG_ERROR57, MSG_SCIMSG81, MSG_SCIMSG82, NULL, ReplaceSlash(), sciprint(), SendCTRLandAKey(), StoreCommand1(), TextCopyClip(), TEXTMETRIC, type, and UINT.

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 call graph for this function:

void ReAllocScreenBuffer ( LPTW  lptw  ) 

Definition at line 1622 of file wtext.c.

References AddLines, tagTW::AttrBuffer, tagTW::CharSize, tagTW::CursorPos, FREE, MALLOC, memcpy(), NOTEXT, NULL, tagTW::ScreenBuffer, tagTW::ScreenSize, tagTW::ScrollMax, and szNoMemory.

Referenced by ResizeScreenBuffer().

01623 {
01624         #define AddLines 360 /* Ajout de l'equivalent d'une page initiale */
01625         
01626         HGLOBAL hglobal;
01627         int NombredeCaracteres=0;
01628         BYTE *CopyOfScreenBuffer=NULL;
01629         BYTE *CopyOfAttribBuffer=NULL;
01630         int NewScreenSizeY=0;
01631                 
01632         /* Nombre de caracteres réellement utilisé */
01633         NombredeCaracteres=lptw->CursorPos.y * lptw->ScreenSize.x + lptw->CursorPos.x;
01634         CopyOfScreenBuffer=(char*)MALLOC( (NombredeCaracteres+1)* sizeof(char));
01635         if (CopyOfScreenBuffer == NULL)
01636         {
01637                 MessageBox ((HWND) NULL, szNoMemory, (LPSTR) NULL, MB_ICONHAND | MB_SYSTEMMODAL);
01638                 return;
01639         }
01640         /* Copie des caracteres dans un buffer intermédiaire */
01641         strncpy(CopyOfScreenBuffer,(LPSTR)lptw->ScreenBuffer,NombredeCaracteres);
01642         
01643 
01644         /* Allocation du nouveau buffer */
01645         NewScreenSizeY=lptw->ScreenSize.y+AddLines;
01646         
01647         
01648         hglobal = GlobalHandle (lptw->ScreenBuffer);
01649         if (hglobal)
01650         {
01651                 GlobalUnlock (hglobal);
01652                 GlobalFree (hglobal);
01653         }
01654                 
01655         hglobal = GlobalAlloc (GHND, lptw->ScreenSize.x * NewScreenSizeY);
01656 
01657         lptw->ScreenBuffer = (BYTE FAR *) GlobalLock (hglobal);
01658         if (lptw->ScreenBuffer == (BYTE FAR *) NULL)
01659         {
01660                 MessageBox ((HWND) NULL, szNoMemory, (LPSTR) NULL, MB_ICONHAND | MB_SYSTEMMODAL);
01661                 exit(1);
01662         }
01663         /* initialisation du Screenbuffer */
01664         _fmemset (lptw->ScreenBuffer, ' ', lptw->ScreenSize.x * NewScreenSizeY);
01665         /* Recopie */
01666         memcpy(lptw->ScreenBuffer,CopyOfScreenBuffer,NombredeCaracteres);
01667         /* Libération du buffer intermédiaire */
01668         FREE(CopyOfScreenBuffer);
01669         
01670         /* Idem à ci-dessus pour le buffer des couleurs des caracteres */               
01671         CopyOfAttribBuffer=(char*)MALLOC( (NombredeCaracteres+1)* sizeof(char));
01672         if (CopyOfAttribBuffer == NULL)
01673         {
01674                 MessageBox ((HWND) NULL, szNoMemory, (LPSTR) NULL, MB_ICONHAND | MB_SYSTEMMODAL);
01675                 exit(1);
01676         }
01677         strncpy(CopyOfAttribBuffer,(LPSTR)lptw->AttrBuffer,NombredeCaracteres);
01678         hglobal = GlobalHandle (lptw->AttrBuffer);
01679         if (hglobal)
01680         {
01681                 GlobalUnlock (hglobal);
01682                 GlobalFree (hglobal);
01683         }
01684 
01685         hglobal = GlobalAlloc (GHND, lptw->ScreenSize.x * NewScreenSizeY);
01686         lptw->AttrBuffer = (BYTE FAR *) GlobalLock (hglobal);
01687         if (lptw->AttrBuffer == (BYTE FAR *) NULL)
01688         {
01689                 MessageBox ((HWND) NULL, szNoMemory, (LPSTR) NULL, MB_ICONHAND | MB_SYSTEMMODAL);
01690                 exit(1);
01691         }
01692         _fmemset (lptw->AttrBuffer, NOTEXT, lptw->ScreenSize.x * NewScreenSizeY);
01693         memcpy(lptw->AttrBuffer,CopyOfAttribBuffer,NombredeCaracteres);
01694         FREE(CopyOfAttribBuffer);
01695         
01696         /* Nouveau Max. de la scrollbar verticale */
01697         lptw->ScrollMax.y=lptw->ScrollMax.y+(lptw->CharSize.y*AddLines);
01698         
01699         lptw->ScreenSize.y=NewScreenSizeY;
01700 }

Here is the call graph for this function:

Here is the caller graph for this function:

static BOOL RegisterParentWindowClass ( LPTW  lptw  )  [static]

Definition at line 101 of file wtext.c.

References FALSE, GetIhmTextBackgroundColor(), tagTW::hInstance, MSG_ERROR53, NULL, szParentClass, TRUE, and WndParentProc().

Referenced by CreateTextClass().

00102 {
00103         BOOL bOK=FALSE;
00104         WNDCLASS Parentwndclass;
00105         Parentwndclass.lpszClassName = szParentClass;
00106         Parentwndclass.lpfnWndProc = WndParentProc;
00107         Parentwndclass.style = CS_HREDRAW | CS_VREDRAW;
00108         Parentwndclass.cbClsExtra = 0;
00109         Parentwndclass.cbWndExtra = 2 * sizeof (void FAR *);
00110         Parentwndclass.hInstance = lptw->hInstance;
00111         Parentwndclass.hIcon = LoadIcon (NULL, IDI_APPLICATION);
00112         Parentwndclass.hCursor = LoadCursor (NULL, IDC_WAIT);
00113         Parentwndclass.hbrBackground =(HBRUSH) CreateSolidBrush (GetIhmTextBackgroundColor()) ;
00114         Parentwndclass.lpszMenuName = NULL;
00115 
00116         if (!RegisterClass(&Parentwndclass))
00117         {
00118                 DWORD dwLastError = GetLastError();
00119                 char buff1[1000], buff2[1000];
00120 
00121                 FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, dwLastError, 0, buff1, sizeof (buff1), NULL);
00122                 sprintf(buff2, MSG_ERROR53, dwLastError);
00123 
00124                 MessageBox(NULL, buff1, buff2, MB_ICONERROR);
00125 
00126                 bOK=FALSE;
00127         }
00128         else bOK=TRUE;
00129 
00130         return bOK;
00131 }

Here is the call graph for this function:

Here is the caller graph for this function:

static BOOL RegisterTextWindowClass ( LPTW  lptw  )  [static]

Definition at line 133 of file wtext.c.

References FALSE, GetIhmTextBackgroundColor(), tagTW::hbrBackground, tagTW::hInstance, MSG_ERROR53, NULL, szTextClass, TRUE, and WndTextProc().

Referenced by CreateTextClass().

00134 {
00135         BOOL bOK=FALSE;
00136         WNDCLASS Textwndclass;
00137         Textwndclass.style = CS_HREDRAW | CS_VREDRAW;
00138         Textwndclass.lpfnWndProc = WndTextProc;
00139         Textwndclass.cbClsExtra = 0;
00140         Textwndclass.cbWndExtra = 2 * sizeof (void FAR *);
00141         Textwndclass.hInstance = lptw->hInstance;
00142         Textwndclass.hIcon = LoadIcon (NULL, IDI_APPLICATION);
00143         Textwndclass.hCursor = LoadCursor (NULL, IDC_WAIT);
00144         Textwndclass.hbrBackground =(HBRUSH) CreateSolidBrush (GetIhmTextBackgroundColor());
00145         Textwndclass.lpszMenuName = NULL;
00146         Textwndclass.lpszClassName = szTextClass;
00147         if (!RegisterClass(&Textwndclass))
00148         {
00149                 DWORD dwLastError = GetLastError();
00150                 char buff1[1000], buff2[1000];
00151 
00152                 FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, dwLastError, 0, buff1, sizeof (buff1), NULL);
00153                 sprintf(buff2, MSG_ERROR53, dwLastError);
00154 
00155                 MessageBox(NULL, buff1, buff2, MB_ICONERROR);
00156 
00157                 bOK=FALSE;
00158         }
00159         else 
00160         {
00161                 lptw->hbrBackground =(HBRUSH) CreateSolidBrush (GetIhmTextBackgroundColor());
00162                 bOK=TRUE;
00163         }
00164 
00165         return bOK;
00166 
00167 }

Here is the call graph for this function:

Here is the caller graph for this function:

void ReLoadMenus ( LPTW  lptw  ) 

Definition at line 1818 of file wmenu.c.

References CloseMacros(), tagMW::hButton, i, LoadMacros(), tagTW::lpmw, tagMW::nButton, ToolBarOnOff(), and UpdateFileNameMenu().

Referenced by ResetMenu(), SwitchLanguage(), and TextInit().

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 }

Here is the call graph for this function:

Here is the caller graph for this function:

void ReorganizeScreenBuffer ( LPTW  lptw  ) 

Definition at line 1702 of file wtext.c.

References tagTW::AttrBuffer, tagTW::CharSize, tagTW::CursorPos, FREE, MALLOC, NOTEXT, NULL, RemoveLines, tagTW::ScreenBuffer, tagTW::ScreenSize, and tagTW::ScrollPos.

Referenced by ResizeScreenBuffer().

01703 {
01704         #define RemoveLines 120
01705         int DecalageY=0;
01706         int NombredeCaracteres=0;
01707         
01708         BYTE *CopyOfScreenBuffer=NULL;
01709         BYTE *CopyOfAttribBuffer=NULL;
01710         
01711                                 
01712     NombredeCaracteres=lptw->CursorPos.y * lptw->ScreenSize.x + lptw->CursorPos.x;
01713         
01714     DecalageY=lptw->ScreenSize.x*RemoveLines;
01715 
01716         
01717         CopyOfScreenBuffer=(char*)MALLOC( (NombredeCaracteres+1)* sizeof(char));
01718                         
01719     strncpy(CopyOfScreenBuffer,(LPSTR)(lptw->ScreenBuffer+DecalageY),NombredeCaracteres-DecalageY);
01720     _fmemset (lptw->ScreenBuffer, ' ', lptw->ScreenSize.x * lptw->ScreenSize.y);
01721     strncpy((LPSTR)lptw->ScreenBuffer,CopyOfScreenBuffer,NombredeCaracteres-DecalageY);
01722     FREE(CopyOfScreenBuffer);
01723                         
01724                         
01725     CopyOfAttribBuffer=(char*)MALLOC( (NombredeCaracteres+1)* sizeof(char));
01726     strncpy(CopyOfAttribBuffer,(LPSTR)(lptw->AttrBuffer+DecalageY),NombredeCaracteres-DecalageY);
01727     _fmemset (lptw->AttrBuffer, NOTEXT, lptw->ScreenSize.x * lptw->ScreenSize.y);
01728     strncpy((LPSTR)lptw->AttrBuffer,CopyOfAttribBuffer,NombredeCaracteres-DecalageY);
01729     FREE(CopyOfAttribBuffer);
01730         
01731         
01732     lptw->CursorPos.y=lptw->CursorPos.y-RemoveLines;
01733     lptw->ScrollPos.y=lptw->ScrollPos.y-(RemoveLines*lptw->CharSize.y);
01734 }

Here is the caller graph for this function:

int ReplacePrompt ( char *  Text,
char *  prompt 
)

Definition at line 1549 of file wtext.c.

References FALSE, FREE, j, l, MALLOC, NULL, and TRUE.

Referenced by CleanPromptFromText().

01551 {
01552         int Retour=FALSE;
01553         int l=0;
01554         char *TextTMP=NULL;
01555         char *LocalPrompt=NULL;
01556         
01557         char *OccurenceDebutPrompt=NULL;
01558         
01559         LocalPrompt=(char*)MALLOC((strlen(prompt)+1)*sizeof(char));
01560         TextTMP=(char*)MALLOC((strlen(Text)+1)*sizeof(char));
01561         
01562         strcpy(TextTMP,Text);
01563         strcpy(LocalPrompt,prompt);
01564         
01565         l=strlen(LocalPrompt);
01566 
01567         while ( OccurenceDebutPrompt = strstr(TextTMP,LocalPrompt) )
01568         {
01569                 int j=0;
01570                 if (OccurenceDebutPrompt)
01571                 {
01572                         for(j=0;j< (signed)(  strlen(OccurenceDebutPrompt)- strlen(LocalPrompt) );j++)          
01573                         {
01574                                 OccurenceDebutPrompt[j]=OccurenceDebutPrompt[j+strlen(LocalPrompt)];
01575                         }
01576                         OccurenceDebutPrompt[j]='\0';
01577                 Retour=TRUE;    
01578                 }       
01579 
01580         }
01581         
01582         strcpy(Text,TextTMP);           
01583         
01584         FREE(TextTMP);
01585         FREE(LocalPrompt);
01586         return Retour;
01587         
01588 }

Here is the caller graph for this function:

void ReplaceSlash ( char *  pathout,
char *  pathin 
)

Definition at line 1682 of file wmenu.c.

References i, and int.

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 ResizeScreenBuffer ( LPTW  lptw  ) 

Definition at line 1593 of file wtext.c.

References FALSE, tagTW::hWndText, ReAllocScreenBuffer(), ReorganizeScreenBuffer(), SB_HORZ, SB_VERT, ScreenBufferSizeMaxY, tagTW::ScreenSize, tagTW::ScrollMax, tagTW::ScrollPos, and TRUE.

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 call graph for this function:

void ScilabFxFadeOut ( void   ) 

Definition at line 50 of file Transparency.c.

References GetCurrentAlphaLevel(), GetTextWinScilab(), tagTW::hWndParent, tagTW::hWndText, i, and SetCurrentAlphaLevel().

Referenced by ExitWindow().

00051 {
00052         LPTW lptw=GetTextWinScilab();
00053         int i=0;
00054         for (i=GetCurrentAlphaLevel();i>=0;i=i-16)
00055         {
00056                 SetCurrentAlphaLevel(lptw->hWndParent ,i);
00057                 SetCurrentAlphaLevel(lptw->hWndText ,i);
00058         }
00059 }

Here is the call graph for this function:

Here is the caller graph for this function:

int C2F() sciquit (  ) 

TODO : comment

Returns:

Definition at line 47 of file sciquit.c.

00048 {
00049         int status = 0;
00050         ExitScilab();
00051         sci_exit(status) ;
00052         return 0;
00053 }

void SelectAll ( LPTW  lptw,
BOOL  DoAMark 
)

Definition at line 1850 of file wtext.c.

References tagTW::CharSize, ClearMark(), tagTW::CursorPos, DoMark(), HasAZoneTextSelected(), tagTW::hPopMenu, tagTW::hWndText, M_COPY_CLIP, M_EVALSELECTION, M_HELPON, M_OPENSELECTION, M_PRINTSELECTION, tagTW::MarkBegin, tagTW::MarkEnd, pt, tagTW::ScrollPos, and TRUE.

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 call graph for this function:

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 SetReadyOrNotForAnewLign ( BOOL  Ready  ) 

Definition at line 44 of file clipboard.c.

00045 {
00046         ReadyForAnewLign=Ready;
00047 }

void SetThreadPasteRunning ( BOOL  Running  ) 

Definition at line 301 of file clipboard.c.

References ThreadPasteRunning.

Referenced by ExitWindow().

00302 {
00303         ThreadPasteRunning=Running;
00304 }

Here is the caller graph for this function:

EXPORT void WINAPI TextAttr ( LPTW  lptw,
BYTE  attr 
)

Definition at line 1072 of file wtext.c.

References tagTW::Attr.

Referenced by user_putc(), and user_puts().

01073 {
01074   lptw->Attr = attr;
01075 }

Here is the caller graph for this function:

EXPORT void WINAPI TextClearEOL ( LPTW  lptw  ) 

Definition at line 965 of file wtext.c.

References tagTW::AttrBuffer, tagTW::CharSize, ClearMark(), tagTW::CursorPos, GetIhmTextBackgroundColor(), GetIhmTextColor(), hdc, tagTW::hfont, tagTW::hWndText, len, NOTEXT, pt, tagTW::ScreenBuffer, tagTW::ScreenSize, tagTW::ScrollPos, and void().

00966 {
00967 HDC hdc;
00968 int xpos, ypos;
00969 int from, len;
00970 POINT pt;
00971         pt.x = pt.y = 0;
00972         ClearMark(lptw, pt);
00973         from = lptw->CursorPos.y*lptw->ScreenSize.x + lptw->CursorPos.x;
00974         len = lptw->ScreenSize.x-lptw->CursorPos.x;
00975         _fmemset(lptw->ScreenBuffer + from, ' ', len);
00976         _fmemset(lptw->AttrBuffer + from, NOTEXT, len);
00977         xpos = lptw->CursorPos.x*lptw->CharSize.x - lptw->ScrollPos.x;
00978         ypos = lptw->CursorPos.y*lptw->CharSize.y - lptw->ScrollPos.y;
00979         hdc = GetDC(lptw->hWndText);
00980 
00981         SetTextColor(hdc, GetIhmTextColor());
00982         SetBkColor(hdc, GetIhmTextBackgroundColor());
00983         
00984         SelectObject(hdc, (lptw->hfont));
00985         TextOut(hdc,xpos,ypos,
00986                 (LPSTR)(lptw->ScreenBuffer + lptw->CursorPos.y*lptw->ScreenSize.x + 
00987                 lptw->CursorPos.x), lptw->ScreenSize.x-lptw->CursorPos.x);
00988         (void)ReleaseDC(lptw->hWndText,hdc);
00989 }

Here is the call graph for this function:

EXPORT void WINAPI TextClearEOS ( LPTW  lptw  ) 

Definition at line 993 of file wtext.c.

References tagTW::AttrBuffer, ClearMark(), tagTW::CursorPos, tagTW::hWndText, len, NOTEXT, pt, tagTW::ScreenBuffer, and tagTW::ScreenSize.

00994 {
00995   RECT rect;
00996   int from, len;
00997   POINT pt;
00998   pt.x = pt.y = 0;
00999   ClearMark (lptw, pt);
01000   from = lptw->CursorPos.y * lptw->ScreenSize.x + lptw->CursorPos.x;
01001   len = lptw->ScreenSize.x - lptw->CursorPos.x +
01002     (lptw->ScreenSize.y - lptw->CursorPos.y - 1) * lptw->ScreenSize.x;
01003   _fmemset(lptw->ScreenBuffer + from, ' ', len);
01004   _fmemset(lptw->AttrBuffer + from, NOTEXT, len);
01005   GetClientRect (lptw->hWndText, (LPRECT) & rect);
01006   InvalidateRect (lptw->hWndText, (LPRECT) & rect, 1);
01007   UpdateWindow (lptw->hWndText);
01008 }

Here is the call graph for this function:

EXPORT void WINAPI TextClose ( LPTW  lptw  ) 

Definition at line 295 of file wtext.c.

References tagTW::AttrBuffer, CloseMacros(), tagTW::hWndParent, tagTW::KeyBuf, tagTW::lpmw, NULL, tagTW::ScreenBuffer, and TextMessage().

00296 {
00297   HGLOBAL hglobal;
00298 
00299   /* close window */
00300   if (lptw->hWndParent)DestroyWindow (lptw->hWndParent);
00301   TextMessage ();
00302 
00303   hglobal = GlobalHandle (lptw->ScreenBuffer);
00304   if (hglobal)
00305     {
00306       GlobalUnlock (hglobal);
00307       GlobalFree (hglobal);
00308     }
00309   hglobal = GlobalHandle (lptw->AttrBuffer);
00310   if (hglobal)
00311     {
00312       GlobalUnlock (hglobal);
00313       GlobalFree (hglobal);
00314     }
00315   hglobal = GlobalHandle (lptw->KeyBuf);
00316   if (hglobal)
00317     {
00318       GlobalUnlock (hglobal);
00319       GlobalFree (hglobal);
00320     }
00321 
00322   if (lptw->lpmw)  CloseMacros (lptw);
00323   lptw->hWndParent = (HWND) NULL;
00324 }

Here is the call graph for this function:

EXPORT void WINAPI TextCursorHeight ( LPTW  lptw,
int  height 
)

Definition at line 958 of file wtext.c.

References tagTW::bFocus, tagTW::CaretHeight, tagTW::CharSize, and tagTW::hWndText.

00959 {
00960   lptw->CaretHeight = height;
00961   if (lptw->bFocus)
00962     CreateCaret (lptw->hWndText, 0, lptw->CharSize.x, 2 + lptw->CaretHeight);
00963 }

EXPORT void WINAPI TextDeleteLine ( LPTW  lptw  ) 

Definition at line 1030 of file wtext.c.

References tagTW::AttrBuffer, ClearMark(), tagTW::CursorFlag, tagTW::CursorPos, tagTW::hWndText, len, NOTEXT, pt, tagTW::ScreenBuffer, tagTW::ScreenSize, and TextToCursor().

01031 {
01032   RECT rect;
01033   int from, to, len;
01034   POINT pt;
01035   pt.x = pt.y = 0;
01036   ClearMark (lptw, pt);
01037   to = lptw->CursorPos.y * lptw->ScreenSize.x,
01038     from = (lptw->CursorPos.y + 1) * lptw->ScreenSize.x;
01039   len = (lptw->ScreenSize.y - lptw->CursorPos.y - 1) * lptw->ScreenSize.x;
01040   _fmemmove(lptw->ScreenBuffer + to, lptw->ScreenBuffer + from, len);
01041   _fmemmove(lptw->AttrBuffer + to, lptw->AttrBuffer + from, len);
01042   from = lptw->ScreenSize.x * (lptw->ScreenSize.y - 1);
01043   _fmemset(lptw->ScreenBuffer + from, ' ', lptw->ScreenSize.x);
01044   _fmemset(lptw->AttrBuffer + from, NOTEXT, lptw->ScreenSize.x);
01045   GetClientRect (lptw->hWndText, (LPRECT) & rect);
01046   InvalidateRect (lptw->hWndText, (LPRECT) & rect, 1);
01047   UpdateWindow (lptw->hWndText);
01048   if (lptw->CursorFlag) TextToCursor (lptw);
01049 }

Here is the call graph for this function:

EXPORT int WINAPI TextGetCh ( LPTW  lptw  ) 

Definition at line 806 of file wtext.c.

References tagTW::bFocus, tagTW::bGetCh, tagTW::CaretHeight, tagTW::CharAscent, tagTW::CharSize, CTRLE, tagTW::CursorPos, FALSE, GetThreadPasteRunning(), HasAZoneTextSelected(), tagTW::hWndText, tagTW::KeyBuf, tagTW::KeyBufOut, tagTW::KeyBufSize, tagTW::ScrollPos, SendCTRLandAKey(), TextCopyClip(), TextKBHit(), TextMessage(), TextToCursor(), TRUE, and WriteInKeyBuf.

00807 {
00808   int ch;
00809   
00810   lptw->bGetCh = TRUE;
00811   
00812   TextToCursor (lptw);
00813   
00814   if (lptw->bFocus)
00815     {
00816       SetCaretPos (lptw->CursorPos.x * lptw->CharSize.x - lptw->ScrollPos.x,
00817                    lptw->CursorPos.y * lptw->CharSize.y + lptw->CharAscent
00818                    - lptw->CaretHeight - lptw->ScrollPos.y);
00819       ShowCaret (lptw->hWndText);
00820     }
00821 
00832   do 
00833   {
00834     if ( (!GetThreadPasteRunning()) && (!WriteInKeyBuf) ) Sleep(1); 
00835     TextMessage();
00836   } while (!TextKBHit(lptw));
00837   
00838   ch = *lptw->KeyBufOut++;
00839   
00840   
00841   /* Interception de Ctrl+C */
00842   if (ch == (char)3) 
00843   {
00844         if ( HasAZoneTextSelected(lptw) )
00845           {
00846                 TextCopyClip(lptw);
00847                 SendCTRLandAKey(CTRLE);
00848                 return 1;
00849                 
00850           }
00851   }
00852   
00853   if (lptw->KeyBufOut - lptw->KeyBuf >= (int) lptw->KeyBufSize)   lptw->KeyBufOut = lptw->KeyBuf;       /* wrap around */
00854 
00855   if (lptw->bFocus)  HideCaret (lptw->hWndText);
00856   
00857   lptw->bGetCh = FALSE;
00858   return ch;
00859   
00860 }

Here is the call graph for this function:

EXPORT int WINAPI TextGetChE ( LPTW  lptw  ) 

Definition at line 896 of file wtext.c.

References TextGetCh(), and TextPutCh().

00897 {
00898   int ch;
00899   ch = TextGetCh (lptw);
00900   TextPutCh (lptw, (BYTE) ch);
00901   return ch;
00902 }

Here is the call graph for this function:

EXPORT LPSTR WINAPI TextGetS ( LPTW  lptw,
LPSTR  str,
unsigned int  size 
)

Definition at line 904 of file wtext.c.

References NULL, and TextGetChE().

00905 {
00906   LPSTR next = str;
00907   
00908   while (--size > 0)
00909     {
00910       switch (*next = TextGetChE (lptw))
00911         {
00912         case EOF:
00913           *next = '\0';
00914           if (next == str)
00915             return (char *) NULL;
00916           return str;
00917         case '\n':
00918           *(next + 1) = '\0';
00919           return str;
00920         case 0x08:
00921         case 0x7f:
00922           if (next > str)
00923             --next;
00924           break;
00925         default:
00926           ++next;
00927         }
00928     }
00929   *next = '\0';
00930   return str;
00931 }

Here is the call graph for this function:

EXPORT void WINAPI TextGotoXY ( LPTW  lptw,
int  x,
int  y 
)

Definition at line 942 of file wtext.c.

References tagTW::CursorPos.

00943 {
00944   lptw->CursorPos.x = x;
00945   lptw->CursorPos.y = y;
00946 }

EXPORT int WINAPI TextInit ( LPTW  lptw  ) 

Definition at line 181 of file wtext.c.

References tagTW::Attr, tagTW::AttrBuffer, tagTW::bFocus, tagTW::bGetCh, tagTW::bSysColors, tagTW::ButtonHeight, tagTW::CaretHeight, CreateTextClass(), tagTW::CursorPos, DisableMenus(), DisableToolBar(), FALSE, tagTW::hInstance, tagTW::hPrevInstance, tagTW::hWndParent, tagTW::hWndText, InitIhmDefaultColor(), tagTW::KeyBuf, KeyBufferSize, tagTW::KeyBufIn, tagTW::KeyBufOut, tagTW::KeyBufSize, LoadMacros(), tagTW::lpmw, M_ABOUT, M_CONSOLE, MF_SEPARATOR, MSG_ERROR54, MSG_ERROR55, MSG_SCIMSG56, MSG_SCIMSG57, tagTW::nCmdShow, NOTEXT, NULL, OnRightClickMenu(), tagTW::Origin, ReadRegistryTxt(), ReLoadMenus(), tagTW::ScreenBuffer, tagTW::ScreenSize, ScrollSize, SetFocus(), tagTW::Size, SW_SHOWNORMAL, szNoMemory, szParentClass, szTextClass, TextMessage(), tagTW::Title, and ToolBarOnOff().

00182 {
00183   RECT rect;
00184   HMENU sysmenu;
00185   HGLOBAL hglobal;
00186   
00187   lptw->hWndParent=NULL;
00188   lptw->hWndText=NULL;
00189 
00190   ReadRegistryTxt (lptw);
00191   if (lptw->bSysColors) InitIhmDefaultColor();
00192 
00193   if (!lptw->hPrevInstance)    CreateTextClass (lptw);
00194 
00195   if (lptw->KeyBufSize == 0)    lptw->KeyBufSize = KeyBufferSize;
00196 
00197    /* Modified by D.Abdemouche 20/05/03 */
00198   if (lptw->ScreenSize.x < ScrollSize.x)  lptw->ScreenSize.x = ScrollSize.x;
00199   if (lptw->ScreenSize.y < ScrollSize.y)  lptw->ScreenSize.y = ScrollSize.y;
00200 
00201   lptw->CursorPos.x = lptw->CursorPos.y = 0;
00202   lptw->bFocus = FALSE;
00203   lptw->bGetCh = FALSE;
00204   lptw->CaretHeight = 0;
00205   if (!lptw->nCmdShow)
00206     lptw->nCmdShow = SW_SHOWNORMAL;
00207   if (!lptw->Attr)
00208     lptw->Attr = 0xf0;          /* black on white */
00209 
00210   hglobal = GlobalAlloc (GHND, lptw->ScreenSize.x * lptw->ScreenSize.y);
00211 
00212   /* sauvegarde de hglobal pour reallocation ultérieure */
00213   lptw->ScreenBuffer = (BYTE FAR *) GlobalLock (hglobal);
00214   if (lptw->ScreenBuffer == (BYTE FAR *) NULL)
00215     {
00216       MessageBox ((HWND) NULL, szNoMemory, (LPSTR) NULL, MB_ICONHAND | MB_SYSTEMMODAL);
00217       return (1);
00218     }
00219   _fmemset (lptw->ScreenBuffer, ' ', lptw->ScreenSize.x * lptw->ScreenSize.y);
00220   hglobal = GlobalAlloc (GHND, lptw->ScreenSize.x * lptw->ScreenSize.y);
00221   lptw->AttrBuffer = (BYTE FAR *) GlobalLock (hglobal);
00222   if (lptw->AttrBuffer == (BYTE FAR *) NULL)
00223     {
00224       MessageBox ((HWND) NULL, szNoMemory, (LPSTR) NULL, MB_ICONHAND | MB_SYSTEMMODAL);
00225       return (1);
00226     }
00227   _fmemset (lptw->AttrBuffer, NOTEXT, lptw->ScreenSize.x * lptw->ScreenSize.y);
00228   
00229   hglobal = GlobalAlloc (GHND, lptw->KeyBufSize);
00230     /* hglobal = GlobalAlloc (LHND, lptw->KeyBufSize); */
00231   /* Modification Allan CORNET LHND pour LocalAlloc et non pour GlobalAlloc*/
00232   lptw->KeyBuf = (BYTE FAR *) GlobalLock (hglobal);
00233   
00234   if (lptw->KeyBuf == (BYTE FAR *) NULL)
00235     {
00236       MessageBox ((HWND) NULL, szNoMemory, (LPSTR) NULL, MB_ICONHAND | MB_SYSTEMMODAL);
00237       return (1);
00238     }
00239   _fmemset (lptw->KeyBuf, ' ', lptw->KeyBufSize);  
00240   lptw->KeyBufIn = lptw->KeyBufOut = lptw->KeyBuf;
00241   
00242   
00243   lptw->hWndParent = CreateWindow (szParentClass, lptw->Title,
00244                                    WS_OVERLAPPEDWINDOW,
00245                                    lptw->Origin.x, lptw->Origin.y,
00246                                    lptw->Size.x, lptw->Size.y,
00247                                    NULL, NULL, lptw->hInstance, lptw);
00248 
00249   if (lptw->hWndParent == (HWND) NULL)
00250     {
00251       MessageBox ((HWND) NULL, MSG_ERROR54, (LPSTR) NULL, MB_ICONHAND | MB_SYSTEMMODAL);
00252       return (1);
00253     }
00254   ShowWindow (lptw->hWndParent, lptw->nCmdShow);
00255   GetClientRect (lptw->hWndParent, &rect);
00256 
00257   lptw->hWndText = CreateWindow (szTextClass, lptw->Title,
00258                                  WS_CHILD | WS_VSCROLL | WS_HSCROLL,
00259                                  0, lptw->ButtonHeight,
00260                                rect.right, rect.bottom - lptw->ButtonHeight,
00261                              lptw->hWndParent, NULL, lptw->hInstance, lptw);
00262                              
00263   if (lptw->hWndText == (HWND) NULL)
00264     {
00265       MessageBox ((HWND) NULL, MSG_ERROR55, (LPSTR) NULL, MB_ICONHAND | MB_SYSTEMMODAL);
00266       return (1);
00267     }
00268     
00269   OnRightClickMenu(lptw) ; 
00270  
00271   sysmenu = GetSystemMenu (lptw->hWndParent, 0);        /* get the sysmenu */
00272   AppendMenu (sysmenu, MF_SEPARATOR, 0, NULL);
00273   AppendMenu (sysmenu, MF_STRING, M_CONSOLE, MSG_SCIMSG56);
00274   AppendMenu (sysmenu, MF_SEPARATOR, 0, NULL);
00275   AppendMenu (sysmenu, MF_STRING, M_ABOUT, MSG_SCIMSG57);
00276 
00277   if (lptw->lpmw)    LoadMacros (lptw);
00278   ReLoadMenus(lptw);
00279 
00280   DisableMenus(lptw);
00281 
00282   ToolBarOnOff(lptw);
00283   DisableToolBar(lptw);
00284   OnRightClickMenu(lptw);
00285 
00286   ShowWindow (lptw->hWndText, SW_SHOWNORMAL);
00287   BringWindowToTop (lptw->hWndText);
00288   SetFocus (lptw->hWndText);
00289   TextMessage ();
00290   
00291   return (0);
00292 }

Here is the call graph for this function:

EXPORT void WINAPI TextInsertLine ( LPTW  lptw  ) 

Definition at line 1010 of file wtext.c.

References tagTW::AttrBuffer, ClearMark(), tagTW::CursorFlag, tagTW::CursorPos, tagTW::hWndText, len, NOTEXT, pt, tagTW::ScreenBuffer, tagTW::ScreenSize, and TextToCursor().

01011 {
01012   RECT rect;
01013   int from, to, len;
01014   POINT pt;
01015   pt.x = pt.y = 0;
01016   ClearMark (lptw, pt);
01017   from = lptw->CursorPos.y * lptw->ScreenSize.x,
01018     to = (lptw->CursorPos.y + 1) * lptw->ScreenSize.x;
01019   len = (lptw->ScreenSize.y - lptw->CursorPos.y - 1) * lptw->ScreenSize.x;
01020   _fmemmove(lptw->ScreenBuffer + to, lptw->ScreenBuffer + from, len);
01021   _fmemmove(lptw->AttrBuffer + to, lptw->AttrBuffer + from, len);
01022   _fmemset(lptw->ScreenBuffer + from, ' ', lptw->ScreenSize.x);
01023   _fmemset(lptw->AttrBuffer + from, NOTEXT, lptw->ScreenSize.x);
01024   GetClientRect (lptw->hWndText, (LPRECT) & rect);
01025   InvalidateRect (lptw->hWndText, (LPRECT) & rect, 1);
01026   UpdateWindow (lptw->hWndText);
01027   if (lptw->CursorFlag)    TextToCursor (lptw);
01028 }

Here is the call graph for this function:

EXPORT int WINAPI TextKBHit ( LPTW  lptw  ) 

Definition at line 795 of file wtext.c.

References tagTW::KeyBufIn, and tagTW::KeyBufOut.

00796 {
00797   return (lptw->KeyBufIn != lptw->KeyBufOut);
00798 }

void TextMakeFont ( LPTW  lptw  ) 

Definition at line 702 of file wtext.c.

References tagTW::bFocus, tagTW::CaretHeight, tagTW::CharAscent, tagTW::CharSize, tagTW::fontname, tagTW::fontsize, hdc, tagTW::hfont, tagTW::hWndText, int, memset(), NULL, p, SCI_DEFAULT_CHARSET, TEXTMETRIC, and TRUE.

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 call graph for this function:

EXPORT void WINAPI TextMessage ( void   ) 

Definition at line 95 of file wtext.c.

References TextMessage1().

00096 {
00097   TextMessage1 (0);
00098   return;
00099 }

Here is the call graph for this function:

EXPORT int WINAPI TextPutCh ( LPTW  lptw,
BYTE  ch 
)

Definition at line 414 of file wtext.c.

References tagTW::Attr, tagTW::AttrBuffer, tagTW::CursorFlag, tagTW::CursorPos, n, NewLine(), pos, tagTW::ScreenBuffer, tagTW::ScreenSize, TextPutCh(), TextToCursor(), and UpdateText().

00415 {
00416   int pos;
00417 
00418   switch (ch)
00419     {
00420     case '\r':
00421       lptw->CursorPos.x = 0;
00422       if (lptw->CursorFlag)
00423         TextToCursor (lptw);
00424       break;
00425     case '\n':
00426       NewLine (lptw);
00427       break;
00428     case 7:
00429       MessageBeep (MB_OK);
00430       if (lptw->CursorFlag)
00431         TextToCursor (lptw);
00432       break;
00433     case '\t':
00434       {
00435         int n;
00436         for (n = 8 - (lptw->CursorPos.x % 8); n > 0; n--)
00437           TextPutCh (lptw, ' ');
00438       }
00439       break;
00440     case 0x08:
00441     case 0x7f:
00442       lptw->CursorPos.x--;
00443       if (lptw->CursorPos.x < 0)
00444         {
00445           lptw->CursorPos.x = lptw->ScreenSize.x - 1;
00446           lptw->CursorPos.y--;
00447         }
00448       if (lptw->CursorPos.y < 0)
00449         lptw->CursorPos.y = 0;
00450       break;
00451     default:
00452         
00453       pos = lptw->CursorPos.y * lptw->ScreenSize.x + lptw->CursorPos.x;
00454       lptw->ScreenBuffer[pos] = ch;
00455       lptw->AttrBuffer[pos] = lptw->Attr;
00456       UpdateText (lptw, 1);
00457     }
00458   return ch;
00459 }

Here is the call graph for this function:

EXPORT int WINAPI TextPutS ( LPTW  lptw,
LPSTR  str 
)

Definition at line 933 of file wtext.c.

References TextPutStr().

00934 {
00935   TextPutStr (lptw, str);
00936   return str[strlen (str) - 1];
00937 }

Here is the call graph for this function:

void TextPutStr ( LPTW  lptw,
LPSTR  str 
)

Definition at line 461 of file wtext.c.

References tagTW::Attr, tagTW::AttrBuffer, count, tagTW::CursorPos, n, NewLine(), p, tagTW::ScreenBuffer, tagTW::ScreenSize, TextPutCh(), and UpdateText().

00462 {
00463   BYTE FAR *p, FAR * pa;
00464   int count, limit;
00465   while (*str)
00466     {
00467       p = lptw->ScreenBuffer + lptw->CursorPos.y * lptw->ScreenSize.x + lptw->CursorPos.x;
00468       pa = lptw->AttrBuffer + lptw->CursorPos.y * lptw->ScreenSize.x + lptw->CursorPos.x;
00469       limit = lptw->ScreenSize.x - lptw->CursorPos.x;
00470 
00471       for (count = 0; (count < limit) && *str && (iswprint ((int) str[0]) || *str == '\t'); count++)
00472         {
00473           if (*str == '\t')
00474             {
00475               int n;
00476               for (n = 8 - ((lptw->CursorPos.x + count) % 8); (count < limit) & (n > 0); n--, count++)
00477                 {
00478                   *p++ = ' ';
00479                   *pa++ = lptw->Attr;
00480                 }
00481               str++;
00482               count--;
00483             }
00484           else
00485             {
00486               *p++ = *str++;
00487               *pa++ = lptw->Attr;
00488             }
00489         }
00490       if (count > 0)
00491         {
00492           UpdateText (lptw, count);
00493         }
00494       if (*str == '\n')
00495         {
00496           NewLine (lptw);
00497           str++;
00498         }
00499       else if (*str && !iswprint ((int) str[0]) && *str != '\t')
00500         {
00501           TextPutCh (lptw, *str++);
00502         }
00503     }
00504 }

Here is the call graph for this function:

EXPORT void WINAPI TextScrollReverse ( LPTW  lptw  ) 

Definition at line 1051 of file wtext.c.

References tagTW::AttrBuffer, tagTW::CharSize, tagTW::CursorPos, tagTW::hWndText, len, LimitMark(), tagTW::MarkBegin, tagTW::MarkEnd, NOTEXT, NULL, tagTW::ScreenBuffer, and tagTW::ScreenSize.

01052 {
01053   RECT rect;
01054   int len = lptw->ScreenSize.x * (lptw->ScreenSize.y - 1);
01055   _fmemmove(lptw->ScreenBuffer+lptw->ScreenSize.x, lptw->ScreenBuffer, len);
01056   _fmemset(lptw->ScreenBuffer, ' ', lptw->ScreenSize.x);
01057   _fmemmove(lptw->AttrBuffer+lptw->ScreenSize.x, lptw->AttrBuffer, len);
01058   _fmemset(lptw->AttrBuffer, NOTEXT, lptw->ScreenSize.x);
01059   if (lptw->CursorPos.y)
01060     lptw->CursorPos.y--;
01061   ScrollWindow (lptw->hWndText, 0, +lptw->CharSize.y, NULL, NULL);
01062   GetClientRect (lptw->hWndText, (LPRECT) & rect);
01063   rect.top = lptw->ScreenSize.y * lptw->CharSize.y;
01064   if (rect.top < rect.bottom) InvalidateRect (lptw->hWndText, (LPRECT) & rect, 1);
01065   lptw->MarkBegin.y++;
01066   lptw->MarkEnd.y++;
01067   LimitMark (lptw, &lptw->MarkBegin);
01068   LimitMark (lptw, &lptw->MarkEnd);
01069   UpdateWindow (lptw->hWndText);
01070 }

Here is the call graph for this function:

void TextSelectFont ( LPTW  lptw  ) 

Definition at line 738 of file wtext.c.

References tagTW::fontname, tagTW::fontsize, hdc, tagTW::hWndParent, tagTW::hWndText, int, memset(), NULL, p, and TextMakeFont().

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 }

Here is the call graph for this function:

EXPORT void WINAPI TextToCursor ( LPTW  lptw  ) 

Definition at line 327 of file wtext.c.

References tagTW::CharSize, tagTW::ClientSize, tagTW::CursorPos, tagTW::hWndText, max, min, NULL, SB_HORZ, SB_VERT, tagTW::ScrollMax, tagTW::ScrollPos, and TRUE.

00328 {
00329   int nXinc = 0;
00330   int nYinc = 0;
00331   int cxCursor;
00332   int cyCursor;
00333   cyCursor = lptw->CursorPos.y * lptw->CharSize.y;
00334   if ((cyCursor + lptw->CharSize.y > lptw->ScrollPos.y + lptw->ClientSize.y)
00335       || (cyCursor < lptw->ScrollPos.y))
00336     {
00337       nYinc = max (0, cyCursor + lptw->CharSize.y - lptw->ClientSize.y) - lptw->ScrollPos.y;
00338       nYinc = min (nYinc, lptw->ScrollMax.y - lptw->ScrollPos.y);
00339     }
00340   cxCursor = lptw->CursorPos.x * lptw->CharSize.x;
00341   if ((cxCursor + lptw->CharSize.x > lptw->ScrollPos.x + lptw->ClientSize.x)
00342       || (cxCursor < lptw->ScrollPos.x))
00343     {
00344       nXinc = max (0, cxCursor + lptw->CharSize.x - lptw->ClientSize.x / 2) - lptw->ScrollPos.x;
00345       nXinc = min (nXinc, lptw->ScrollMax.x - lptw->ScrollPos.x);
00346     }
00347   if (nYinc || nXinc)
00348     {
00349       lptw->ScrollPos.y += nYinc;
00350       lptw->ScrollPos.x += nXinc;
00351       ScrollWindow (lptw->hWndText, -nXinc, -nYinc, NULL, NULL);
00352       SetScrollPos (lptw->hWndText, SB_VERT, lptw->ScrollPos.y, TRUE);
00353 
00354       SetScrollPos (lptw->hWndText, SB_HORZ, lptw->ScrollPos.x, TRUE);
00355       UpdateWindow (lptw->hWndText);
00356     }
00357 }

EXPORT int WINAPI TextWhereX ( LPTW  lptw  ) 

Definition at line 948 of file wtext.c.

References tagTW::CursorPos.

00949 {
00950   return lptw->CursorPos.x;
00951 }

EXPORT int WINAPI TextWhereY ( LPTW  lptw  ) 

Definition at line 953 of file wtext.c.

References tagTW::CursorPos.

00954 {
00955   return lptw->CursorPos.y;
00956 }

void C2F() tmpdirc ( void   ) 

remove TMPDIR directory

Definition at line 103 of file tmpdir.c.

References get_sci_tmp_dir(), and RemoveDir().

00104 {
00105   char *tmp_dir2 = get_sci_tmp_dir(); 
00106   RemoveDir(tmp_dir2);
00107 }

Here is the call graph for this function:

void ToolBarOnOff ( LPTW  lptw  ) 

Definition at line 131 of file Toolbar.c.

References HideToolBar(), tagTW::lpmw, ON, ShowToolBar(), and tagMW::ShowToolBar.

Referenced by Callback_TOOLBAR(), ON_WND_TEXT_WM_KEY(), ReLoadMenus(), SwitchLanguage(), TextInit(), and ToolBarWin32().

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

Here is the call graph for this function:

Here is the caller graph for this function:

void UnSelect ( LPTW  lptw  ) 

Definition at line 1899 of file wtext.c.

References ClearMark(), tagTW::CursorPos, HasAZoneTextSelected(), tagTW::hPopMenu, M_COPY_CLIP, M_EVALSELECTION, M_HELPON, M_OPENSELECTION, M_PRINTSELECTION, and pt.

Referenced by Callback_PRINT().

01900 {
01901         POINT pt;
01902         pt=lptw->CursorPos;
01903 
01904         ClearMark(lptw, pt);
01905         if  ( !HasAZoneTextSelected(lptw) )
01906           {
01907                 /* Zone Selectionnée --> Activation Menus */
01908                 EnableMenuItem(lptw->hPopMenu,M_COPY_CLIP,MF_GRAYED);
01909             EnableMenuItem(lptw->hPopMenu,M_HELPON,MF_GRAYED);
01910                 EnableMenuItem(lptw->hPopMenu,M_PRINTSELECTION,MF_GRAYED);
01911                 EnableMenuItem(lptw->hPopMenu,M_OPENSELECTION,MF_GRAYED);
01912                 EnableMenuItem(lptw->hPopMenu,M_EVALSELECTION,MF_GRAYED);
01913                 /* EnableMenuItem(lptw->hPopMenu,M_CUT,MF_ENABLED); */
01914                 
01915           }
01916 }

Here is the call graph for this function:

Here is the caller graph for this function:

void UpdateMark ( LPTW  lptw,
POINT  pt 
)

Definition at line 652 of file wtext.c.

References DoMark(), FALSE, LimitMark(), tagTW::MarkBegin, tagTW::MarkEnd, tagTW::ScreenSize, and TRUE.

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 call graph for this function:

void UpdateText ( LPTW  lptw,
int  count 
)

Definition at line 384 of file wtext.c.

References tagTW::CharSize, tagTW::CursorPos, GetIhmTextBackgroundColor(), GetIhmTextColor(), hdc, tagTW::hfont, tagTW::hWndText, NewLine(), tagTW::ScreenBuffer, tagTW::ScreenSize, tagTW::ScrollPos, and TRUE.

00385 {
00386   HDC hdc;
00387         
00388   int xpos, ypos;
00389   xpos = lptw->CursorPos.x * lptw->CharSize.x - lptw->ScrollPos.x;
00390   ypos = lptw->CursorPos.y * lptw->CharSize.y - lptw->ScrollPos.y;
00391   hdc = GetDC (lptw->hWndText);
00392 
00393   SetTextColor (hdc, GetIhmTextColor());
00394   SetBkColor (hdc, GetIhmTextBackgroundColor());
00395 
00396   SelectFont (hdc, lptw->hfont);
00397   TextOut (hdc, xpos, ypos,(LPSTR) (lptw->ScreenBuffer + lptw->CursorPos.y * lptw->ScreenSize.x +  lptw->CursorPos.x), count);
00398   ReleaseDC (lptw->hWndText, hdc);
00399   lptw->CursorPos.x += count;
00400   if (lptw->CursorPos.x >= lptw->ScreenSize.x)  NewLine (lptw);
00401         else
00402         {
00403                 RECT RectZone;
00404 
00405                 RectZone.left=0;
00406                 RectZone.top=ypos;
00407                 RectZone.bottom=ypos+lptw->CharSize.y;
00408                 RectZone.right=xpos+lptw->CharSize.x;
00409 
00410                 InvalidateRect(lptw->hWndText,&RectZone,TRUE);
00411         }
00412 }

Here is the call graph for this function:

EXPORT LRESULT CALLBACK WndParentProc ( HWND  hwnd,
UINT  message,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 59 of file WndConsoleParentProc.c.

References ON_WND_CONSOLE_WM_CLOSE(), ON_WND_CONSOLE_WM_COMMAND(), ON_WND_CONSOLE_WM_COPYDATA(), ON_WND_CONSOLE_WM_CREATE(), ON_WND_CONSOLE_WM_DESTROY(), ON_WND_CONSOLE_WM_DROPFILES(), ON_WND_CONSOLE_WM_ENDSESSION(), ON_WND_CONSOLE_WM_ENTERSIZEMOVE(), ON_WND_CONSOLE_WM_EXITSIZEMOVE(), ON_WND_CONSOLE_WM_GETMINMAXINFO(), ON_WND_CONSOLE_WM_PAINT(), ON_WND_CONSOLE_WM_SETFOCUS(), ON_WND_CONSOLE_WM_SIZE(), ON_WND_CONSOLE_WM_SYSCOLORCHANGE(), and ON_WND_CONSOLE_WM_SYSCOMMAND().

Referenced by RegisterParentWindowClass().

00060 {
00061   switch (message)
00062     {
00063                 case WM_ENTERSIZEMOVE : ON_WND_CONSOLE_WM_ENTERSIZEMOVE();  break;
00064                 case WM_EXITSIZEMOVE  : ON_WND_CONSOLE_WM_EXITSIZEMOVE();  break;
00065                 case WM_SYSCOMMAND    : ON_WND_CONSOLE_WM_SYSCOMMAND(hwnd,wParam,lParam); break;
00066                 case WM_ENDSESSION    : ON_WND_CONSOLE_WM_ENDSESSION(hwnd,wParam,lParam); break;
00067 
00068                 HANDLE_MSG(hwnd,WM_COMMAND,ON_WND_CONSOLE_WM_COMMAND);
00069                 HANDLE_MSG(hwnd,WM_SYSCOLORCHANGE,ON_WND_CONSOLE_WM_SYSCOLORCHANGE);
00070                 HANDLE_MSG(hwnd,WM_PAINT,ON_WND_CONSOLE_WM_PAINT);
00071                 HANDLE_MSG(hwnd,WM_DROPFILES,ON_WND_CONSOLE_WM_DROPFILES);
00072                 HANDLE_MSG(hwnd,WM_CREATE,ON_WND_CONSOLE_WM_CREATE);
00073                 HANDLE_MSG(hwnd,WM_DESTROY,ON_WND_CONSOLE_WM_DESTROY);
00074                 HANDLE_MSG(hwnd,WM_CLOSE,ON_WND_CONSOLE_WM_CLOSE);
00075                 HANDLE_MSG(hwnd,WM_COPYDATA,ON_WND_CONSOLE_WM_COPYDATA);
00076                 HANDLE_MSG(hwnd,WM_SIZE,ON_WND_CONSOLE_WM_SIZE);
00077                 HANDLE_MSG(hwnd,WM_GETMINMAXINFO,ON_WND_CONSOLE_WM_GETMINMAXINFO);
00078                 HANDLE_MSG(hwnd,WM_SETFOCUS,ON_WND_CONSOLE_WM_SETFOCUS);
00079         }
00080   return DefWindowProc (hwnd, message, wParam, lParam);
00081 }

Here is the call graph for this function:

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 write_scilab_synchro ( char *  line  ) 

Definition at line 1809 of file wtext.c.

References hThreadWrite, NULL, Sync, and WriteTextThread().

Referenced by EvaluateSelection().

01812 {
01813         DWORD IdThreadWrite;
01814                 
01815         InitializeCriticalSection(&Sync);
01816         hThreadWrite=CreateThread(NULL,0,(LPTHREAD_START_ROUTINE)WriteTextThread,line,0,(LPDWORD)&IdThreadWrite);
01817         CloseHandle(hThreadWrite);
01818         
01819 }

Here is the call graph for this function:

Here is the caller graph for this function:

void WriteIntoKeyBuffer ( LPTW  lptw,
char *  StringCommand 
)

Definition at line 1949 of file wtext.c.

References count, FALSE, i, tagTW::KeyBuf, tagTW::KeyBufIn, tagTW::KeyBufOut, tagTW::KeyBufSize, TRUE, and WriteInKeyBuf.

01950 {
01951         int lg=0;
01952         int i=0;
01953 
01954         lg=strlen(StringCommand);
01955         WriteInKeyBuf=TRUE;
01956         while(i<lg)
01957                 {
01958                         long count;
01959                         count = lptw->KeyBufIn - lptw->KeyBufOut;
01960                         
01961                         if (count < 0) count = count+lptw->KeyBufSize;
01962                         if (count < (long) (lptw->KeyBufSize-1)) 
01963                         {
01964                                 if (StringCommand[i] == '\t') *lptw->KeyBufIn++ = ' ';
01965                                 else *lptw->KeyBufIn++ = StringCommand[i];
01966                                 if (lptw->KeyBufIn - lptw->KeyBuf >= (signed)lptw->KeyBufSize)
01967                                 lptw->KeyBufIn = lptw->KeyBuf;  /* wrap around */
01968                         }
01969                         i++;    
01970                 }
01971         WriteInKeyBuf=FALSE;
01972 }

BOOL WriteIntoScilab ( LPTW  lptw,
char *  StringCommand 
)

Definition at line 1921 of file wtext.c.

References tagTW::bGetCh, C2F, FALSE, FREE, get_is_reading(), ismenu(), MALLOC, NULL, StoreCommand(), TRUE, and WriteIntoKeyBuffer().

Referenced by Callback_DEMOS().

01922 {
01923         BOOL retour=FALSE;
01924         
01925         if  (( ( C2F (ismenu) () == 1 ) || ( lptw->bGetCh == FALSE ) ) && (!get_is_reading()) )
01926         {
01927                 StoreCommand(StringCommand);
01928         }
01929         else
01930         {
01931                 int lg=0;
01932                 char *CommandLine=NULL;
01933                 
01934                 lg=strlen(StringCommand)+1+1;
01935                 CommandLine=(char*)MALLOC( (lg)*sizeof(char) );
01936 
01937                 sprintf(CommandLine,"%s\n",StringCommand);
01938 
01939                 WriteIntoKeyBuffer(lptw,CommandLine);
01940 
01941                 if (CommandLine) {FREE(CommandLine);CommandLine=NULL;}
01942                 retour=TRUE;
01943         }
01944 
01945         return retour;
01946 }

Here is the call graph for this function:

Here is the caller graph for this function:

DWORD WINAPI WriteTextThread ( LPVOID  lpParam  ) 

Definition at line 1821 of file wtext.c.

References tagTW::bGetCh, C2F, FALSE, GetTextWinScilab(), ismenu(), line, Sync, TEMPOTOUCHE, and write_scilab().

Referenced by write_scilab_synchro().

01822 {
01823         #define TEMPOTOUCHE  1
01824         char *line;
01825         LPTW lptw=GetTextWinScilab();
01826 
01827         line=(char *)lpParam;
01828         
01829         EnterCriticalSection(&Sync);
01830         while ( C2F (ismenu) () == 1 ) {Sleep(TEMPOTOUCHE);}
01831         /* Il n'y a plus rien dans la queue des commandes */
01832         while ( lptw->bGetCh == FALSE ) {Sleep(TEMPOTOUCHE);}
01833                 
01834         /* Nous sommes au prompt */
01835         write_scilab(line);
01836         LeaveCriticalSection(&Sync);
01837         DeleteCriticalSection(&Sync);
01838         return 0;
01839 }

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

BOOL ConsoleIsMinimized = FALSE

Definition at line 46 of file wtext.c.

Referenced by sci_raise_window().

HINSTANCE hdllInstance

Definition at line 88 of file wtext.c.

HANDLE hThreadWrite

Definition at line 86 of file wtext.c.

Referenced by write_scilab_synchro().

char ScilexWindowName[MAX_PATH]

Definition at line 81 of file wtext.c.

Referenced by Callback_NEWSCILAB(), ON_MESSAGEBOXNEWGRAPHICMODE_WM_INITDIALOG(), ON_WND_CONSOLE_WM_CREATE(), and UpdateFileGraphNameMenu().

POINT ScreenMinSize = {16, 4}

Definition at line 82 of file wtext.c.

POINT ScrollSize = {80,360}

Definition at line 83 of file wtext.c.

Referenced by TextInit().

CRITICAL_SECTION Sync

Definition at line 87 of file wtext.c.

Referenced by write_scilab_synchro(), and WriteTextThread().

char szNoMemory[] = "out of memory"

Definition at line 84 of file wtext.c.

Referenced by InitScreenBuffer(), ReAllocScreenBuffer(), and TextInit().

LPSTR szParentClass = "wscilab_parent"

Definition at line 89 of file wtext.c.

Referenced by RegisterParentWindowClass(), and TextInit().

LPSTR szTextClass = "wscilab_text"

Definition at line 90 of file wtext.c.

Referenced by RegisterTextWindowClass(), and TextInit().

BOOL WriteInKeyBuf = FALSE [static]

Definition at line 47 of file wtext.c.

Referenced by TextGetCh(), and WriteIntoKeyBuffer().


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