Ignore:
Timestamp:
Aug 2, 2000, 4:58:40 PM (25 years ago)
Author:
bird
Message:

Added the CVS Id keyword.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/riched32/richedit.c

    r3787 r3922  
     1/* $Id: richedit.c,v 1.3 2000-08-02 14:58:40 bird Exp $ */
    12/*
    23 * RichEdit32  functions
    34 *
    45 * This module is a simple wrap-arround the edit controls.
    5  * At the point, it is good only for application who use the RICHEDIT control to 
     6 * At the point, it is good only for application who use the RICHEDIT control to
    67 * display RTF text.
    78 *
    89 * Copyright 2000 by Jean-Claude Batista
    9  * 
    10  */
    11  
     10 *
     11 */
     12
    1213#include "windows.h"
    1314#include "winbase.h"
     
    4748RICHED32_LibMain (HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
    4849{
    49        
     50
    5051    switch (fdwReason) {
    5152            case DLL_PROCESS_ATTACH:
     
    6061
    6162                }
    62                
     63
    6364                /* register the Rich Edit class */
    6465                RICHED32_Register ();
     
    7071                RICHED32_dwProcessesAttached--;
    7172
    72                 /* unregister all common control classes */     
     73                /* unregister all common control classes */
    7374                RICHED32_Unregister ();
    7475
     
    7778                    RICHED32_hHeap = (HANDLE)NULL;
    7879                }
    79                 break;     
     80                break;
    8081    }
    8182
     
    9495    int RTFToBuffer(char* pBuffer, int nBufferSize);
    9596    LONG newstyle = 0;
    96     LONG style = 0; 
     97    LONG style = 0;
    9798
    9899    static HWND hwndEdit;
    99100    static char* rtfBuffer;
    100101    int rtfBufferSize;
    101    
     102
    102103    switch (uMsg)
    103104    {
    104  
    105     case WM_CREATE :           
    106            
     105
     106    case WM_CREATE :
     107
    107108            /* remove SCROLLBARS from the current window style */
    108109            newstyle = style = ((LPCREATESTRUCTA) lParam)->style;
     
    113114
    114115#ifdef __WIN32OS2__
    115             style |= WS_CHILD;                                 
     116            style |= WS_CHILD;
    116117#endif
    117118            hwndEdit = CreateWindowA ("edit", ((LPCREATESTRUCTA) lParam)->lpszName,
     
    119120                                   hwnd, (HMENU) ID_EDIT,
    120121                                   ((LPCREATESTRUCTA) lParam)->hInstance, NULL) ;
    121        
    122             SetWindowLongA(hwnd,GWL_STYLE, newstyle);             
    123             return 0 ;
    124          
    125     case WM_SETFOCUS :           
     122
     123            SetWindowLongA(hwnd,GWL_STYLE, newstyle);
     124            return 0 ;
     125
     126    case WM_SETFOCUS :
    126127            SetFocus (hwndEdit) ;
    127128            return 0 ;
    128          
    129     case WM_SIZE :             
     129
     130    case WM_SIZE :
    130131            MoveWindow (hwndEdit, 0, 0, LOWORD (lParam), HIWORD (lParam), TRUE) ;
    131132            return 0 ;
    132          
     133
    133134    case WM_COMMAND :
    134135            if (LOWORD (wParam) == ID_EDIT)
    135                  if (HIWORD (wParam) == EN_ERRSPACE || 
     136                 if (HIWORD (wParam) == EN_ERRSPACE ||
    136137                           HIWORD (wParam) == EN_MAXTEXT)
    137138
     
    139140                                  "ERROR", MB_OK | MB_ICONSTOP) ;
    140141            return 0 ;
    141      
    142     case EM_STREAMIN:                               
    143            
     142
     143    case EM_STREAMIN:
     144
    144145            /* setup the RTF parser */
    145146            RTFSetEditStream(( EDITSTREAM*)lParam);
    146147            WriterInit();
    147148            RTFInit ();
    148             BeginFile();           
     149            BeginFile();
    149150
    150151            /* do the parsing */
    151152            RTFRead ();
    152            
     153
    153154            rtfBufferSize = RTFToBuffer(NULL, 0);
    154155            rtfBuffer = HeapAlloc(RICHED32_hHeap, 0,rtfBufferSize*sizeof(char));
     
    161162            else
    162163                WARN("Not enough memory for a allocating rtfBuffer\n");
    163                
    164             return 0;   
     164
     165            return 0;
    165166    }
    166167    /*return SendMessageA( hwndEdit,uMsg,wParam,lParam);*/
     
    188189{
    189190    if (pdvi->cbSize != sizeof(DLLVERSIONINFO)) {
    190  
     191
    191192        return E_INVALIDARG;
    192193    }
     
    203204 * DESCRIPTION:
    204205 * Registers the window class.
    205  * 
     206 *
    206207 * PARAMETER(S):
    207208 * None
     
    212213VOID RICHED32_Register(void)
    213214{
    214     WNDCLASSA wndClass; 
     215    WNDCLASSA wndClass;
    215216
    216217    ZeroMemory(&wndClass, sizeof(WNDCLASSA));
     
    229230 * DESCRIPTION:
    230231 * Unregisters the window class.
    231  * 
     232 *
    232233 * PARAMETER(S):
    233234 * None
Note: See TracChangeset for help on using the changeset viewer.