home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 5 Edit / 05-Edit.zip / edispm11.zip / EDisPM / SRC / Client / EDDLG.CPP < prev    next >
Text File  |  1996-05-12  |  3KB  |  104 lines

  1. /* EDDlg.cpp: EDUserNameDlg:    EDisPM.EXE V 1.1 */
  2. /* Editorclient - Allgemeine Dialogfenster       */
  3. /*                                               */
  4. /* (C) 1995 M.Schwarz, FoPra TU-Muenchen SS1995  */
  5. /* (C) 1996 M.Schwarz, SOMObjects-Programmierung */
  6. /*                     OS/2 Inside 7/96          */
  7. /*                                               */
  8. /* latest changes: 11.5.1996                     */
  9. /*-----------------------------------------------*/
  10.  
  11. /* IUICL Headers */
  12. #include <imsgbox.hpp>
  13. #include <ititle.hpp>
  14.  
  15. /* OS/2-API-Headers */
  16. #ifndef OS2_INCLUDED
  17.    #define INCL_WIN
  18.    #include <os2.h>
  19. #endif
  20.  
  21. /* Application Headers */
  22. #include "EDISPM.H"
  23. #include "EDDLG.HPP"
  24.  
  25. Boolean UserNameDlg::command (ICommandEvent& event)
  26. {
  27.    Boolean dontPassOn = false;
  28.    switch (event.commandId()) {
  29.    case DID_OK:
  30.       *uName = entryName.text();
  31.    case DID_CANCEL:
  32.       ((IFrameWindow*) (event.window()))->dismiss(event.commandId());
  33.       dontPassOn = true;
  34.    } /* endswitch */
  35.    return dontPassOn;
  36. }
  37.  
  38.  
  39. UserNameDlg::UserNameDlg(IFrameWindow* parent, IString *userName) :
  40.    IFrameWindow(IDD_UNAMEBOX, parent),
  41.    entryName(IDD_UENTRY, this)
  42. {
  43.    uName = userName;
  44.    IFrameHandler::handleEventsFor(this);
  45.    setFocus();
  46.    entryName.setText(*uName);
  47.    entryName.setFocus();
  48.    showModally();
  49. }
  50.  
  51.  
  52. /* Dialog-Procedure für die AboutBox (OS/2-Standard) */
  53. MRESULT EXPENTRY AboutBoxDlgProc(HWND hwnd, ULONG msg, MPARAM mp1,MPARAM mp2)
  54. {
  55.    HWND  TextPos;
  56.    IString textstr;
  57.    SHORT i;
  58.    ULONG   ulScrWidth, ulScrHeight;
  59.    RECTL   Rectl;
  60.    SWP     Swp;
  61.    HPS     hps;
  62.  
  63.    switch(msg) {
  64.    case WM_PAINT:
  65.       hps = WinBeginPaint (hwnd,0,0);
  66.       WinQueryWindowRect (hwnd, &Rectl);
  67.       WinFillRect (hps, &Rectl, SYSCLR_DIALOGBACKGROUND);
  68.       Rectl.yTop -= WinQuerySysValue(HWND_DESKTOP,SV_CYTITLEBAR),
  69.  
  70.       WinDrawBorder (hps, &Rectl,
  71.           WinQuerySysValue(HWND_DESKTOP,SV_CXDLGFRAME),
  72.           WinQuerySysValue(HWND_DESKTOP,SV_CYDLGFRAME),
  73.           CLR_DARKGRAY, CLR_WHITE, DB_RAISED);
  74.       GpiMove (hps, (PPOINTL)&Rectl);
  75.       Rectl.xRight--;
  76.       Rectl.yTop--;
  77.       WinQueryWindowPos (WinWindowFromID (hwnd, IDD_ACOPYRIGHTFRAME), &Swp);
  78.       Rectl.xLeft   = Swp.x-1;
  79.       Rectl.yBottom = Swp.y-1;
  80.       Rectl.xRight  = Swp.x + Swp.cx + 1;
  81.       Rectl.yTop    = Swp.y + Swp.cy + 1;
  82.       WinDrawBorder (hps, &Rectl, 1L, 1L,
  83.           CLR_DARKGRAY, CLR_WHITE, DB_DEPRESSED);
  84.       WinQueryWindowPos (WinWindowFromID (hwnd, IDD_APROGRAMFRAME), &Swp);
  85.       Rectl.xLeft   = Swp.x-1;
  86.       Rectl.yBottom = Swp.y-1;
  87.       Rectl.xRight  = Swp.x + Swp.cx + 1;
  88.       Rectl.yTop    = Swp.y + Swp.cy + 1;
  89.       WinDrawBorder (hps, &Rectl, 1L, 1L,
  90.           CLR_DARKGRAY, CLR_WHITE, DB_DEPRESSED);
  91.       WinEndPaint (hps);
  92.       break;
  93.    case WM_COMMAND:
  94.      /* no matter what the command, close the dialog */
  95.       WinDismissDlg(hwnd, TRUE);
  96.       break;
  97.  
  98.    default:
  99.       return(WinDefDlgProc(hwnd, msg, mp1, mp2));
  100.    }
  101.    return(MPVOID);
  102. }  /* AboutBoxWndProc() */
  103.  
  104.