commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mt...@apache.org
Subject cvs commit: jakarta-commons-sandbox/daemon/src/native/nt/procrun procgui.c
Date Thu, 01 May 2003 13:29:51 GMT
mturk       2003/05/01 06:29:51

  Modified:    daemon/src/native/nt/procrun procgui.c
  Log:
  Added browse for folder/file dialogs to ease the
  setting for paths, stderr/stdout files etc...
  
  Revision  Changes    Path
  1.13      +81 -0     jakarta-commons-sandbox/daemon/src/native/nt/procrun/procgui.c
  
  Index: procgui.c
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/daemon/src/native/nt/procrun/procgui.c,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- procgui.c	29 Apr 2003 06:59:16 -0000	1.12
  +++ procgui.c	1 May 2003 13:29:51 -0000	1.13
  @@ -473,6 +473,43 @@
       return FALSE;
   }
   
  +int ac_browse_for_dialog(HWND hwnd, char *str, size_t len, int files)
  +{
  +    int rv = 0;
  +
  +    BROWSEINFO bi;
  +    ITEMIDLIST *il , *ir;
  +    LPMALLOC pMalloc;
  +    
  +    memset(&bi, 0, sizeof(BROWSEINFO));
  +    SHGetSpecialFolderLocation(hwnd, CSIDL_DRIVES, &il);
  +    if (files)
  +        bi.lpszTitle  = "Apache Process Runner :\nSelect Folder!";
  +    else
  +        bi.lpszTitle  = "Apache Process Runner :\nSelect File!";
  +    bi.pszDisplayName = str;
  +    bi.hwndOwner =      hwnd;
  +    bi.ulFlags =        BIF_EDITBOX;
  +    if (files)
  +        bi.ulFlags |=   BIF_BROWSEINCLUDEFILES;
  +
  +    bi.lpfn =           NULL;
  +    bi.lParam =         0;
  +    bi.iImage =         0;
  +    bi.pidlRoot =       il;
  +    
  +    if ((ir = SHBrowseForFolder(&bi)) != NULL) {
  +        SHGetPathFromIDList(ir, str);
  +
  +        rv = 1;
  +    }
  +    if (SHGetMalloc(&pMalloc)) {
  +        pMalloc->lpVtbl->Free(pMalloc, il);
  +        pMalloc->lpVtbl->Release(pMalloc);
  +    }
  +    return rv;
  +    
  +}
   
   void CALLBACK PropSheetCallback(HWND hwndPropSheet, UINT uMsg, LPARAM lParam)
   {
  @@ -506,6 +543,20 @@
       switch (uMessage) {
           case WM_COMMAND:
               PropSheet_Changed(GetParent(hdlg), hdlg);
  +            switch (LOWORD(wParam))  {
  +                case RC_BTN_BIP:
  +                    if (ac_browse_for_dialog(hdlg, txt, 1024, 1))
  +                        SetDlgItemText(hdlg, RC_TXT_IP,
  +                                       txt);
  +                    return TRUE;
  +                break;
  +                case RC_BTN_BWP:
  +                    if (ac_browse_for_dialog(hdlg, txt, 1024, 0))
  +                        SetDlgItemText(hdlg, RC_TXT_WP,
  +                                       txt);
  +                    return TRUE;
  +                break;
  +            }
           break;
           case WM_INITDIALOG:
               ac_center_window(GetParent(hdlg));
  @@ -580,6 +631,15 @@
       switch (uMessage) {
           case WM_COMMAND:
               PropSheet_Changed(GetParent(hdlg), hdlg);
  +            switch (LOWORD(wParam))  {
  +                case RC_BTN_JVM:
  +                    if (ac_browse_for_dialog(hdlg, txt, 1024, 1))
  +                        SetDlgItemText(hdlg, RC_TXT_JVM,
  +                                       txt);
  +                    return TRUE;
  +                break;
  +            }
  +
           break;
           case WM_INITDIALOG:
               SetDlgItemText(hdlg, RC_TXT_JVM, g_env->m->java.display);
  @@ -679,6 +739,27 @@
       switch (uMessage) {
           case WM_COMMAND:
               PropSheet_Changed(GetParent(hdlg), hdlg);
  +            switch (LOWORD(wParam))  {
  +                case RC_BTN_STDI:
  +                    if (ac_browse_for_dialog(hdlg, txt, 1024, 1))
  +                        SetDlgItemText(hdlg, RC_TXT_STDI,
  +                                       txt);
  +                    return TRUE;
  +                break;
  +                case RC_BTN_STDO:
  +                    if (ac_browse_for_dialog(hdlg, txt, 1024, 1))
  +                        SetDlgItemText(hdlg, RC_TXT_STDO,
  +                                       txt);
  +                    return TRUE;
  +                break;
  +                case RC_BTN_STDE:
  +                    if (ac_browse_for_dialog(hdlg, txt, 1024, 1))
  +                        SetDlgItemText(hdlg, RC_TXT_STDE,
  +                                       txt);
  +                    return TRUE;
  +                break;
  +            }
  +
           break;
           case WM_INITDIALOG:
               SetDlgItemText(hdlg, RC_TXT_STDI, g_env->m->service.inname);
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message