Ejemplo n.º 1
0
BOOL far pascal zDlgDirSelect( HWND pp1, LPSTR pp2, int pp3 )
{
    BOOL r;

    SaveRegs();
    /*
    ** Log IN Parameters (No Create/Destroy Checking Yet!)
    */
    LogIn( (LPSTR)"APICALL:DlgDirSelect HWND++int+",
        pp1, (short)0, pp3 );

    /*
    ** Call the API!
    */
    RestoreRegs();
    GrovelDS();
    r = DlgDirSelect(pp1,pp2,pp3);
    UnGrovelDS();
    SaveRegs();
    /*
    ** Log Return Code & OUT Parameters (No Create/Destroy Checking Yet!)
    */
    LogOut( (LPSTR)"APIRET:DlgDirSelect BOOL++LPSTR++",
        r, (short)0, pp2, (short)0 );

    RestoreRegs();
    return( r );
}
Ejemplo n.º 2
0
void CDisciplineLetterTemplate::OnSelchangeFiles() 
{
  DlgDirSelect(m_pszFile, LETTERTEMPLATE_FILES);

  pEditPREVIEW->SetWindowText("");
//
//  Open the text files for preview
//
  CString    inputLine, outputLine;
  CString    fileName;
  CStdioFile Letter;
  
  fileName = szDisciplineLetterTemplateFolder;
  fileName += "\\";
  fileName += m_pszFile;
  Letter.Open(fileName, CFile::modeRead | CFile::typeText | CFile::shareDenyNone);

  if(Letter.m_pStream)
  {
    Letter.SeekToBegin();
    outputLine = "";
    while(Letter.ReadString(inputLine))
    {
      outputLine += inputLine;
      outputLine += "\r\n";
    }
    pEditPREVIEW->SetWindowText(outputLine);
    Letter.Close();
  }
}
BOOL FileBox::flistCmd( HWND hDlg, LPARAM lParam )
{

    switch( HIWORD( lParam ) )
        {
        case LBN_SELCHANGE:     // user changed the selection in the
                                // list box.

            if( DlgDirSelect( hDlg, path, IDD_FLIST ) != 0 )
                strcat( path, iSpec );
                                // current selection is a
                                // path, so append the file spec.

            SetDlgItemText( hDlg, IDD_FNAME, path );
                                // display the new path

            SendDlgItemMessage( hDlg,
                                IDD_FNAME,
                                EM_SETSEL,
                                0,
                                MAKELONG( 0, 0x7FFF )
                                );
                                // select all characters in the file
                                // name edit box.
            return TRUE;

        case LBN_DBLCLK:        // user has double-clicked a selection
                                // in the list box.

            if( DlgDirSelect( hDlg, path, IDD_FLIST ) != 0 )
                strcat( path, iSpec );
                                // current selection is a
                                // path, so append the file spec.

            resetDlg( hDlg );
            return TRUE;

        default:

            return FALSE;

        }
}
Ejemplo n.º 4
0
void CDisciplineLetterTemplate::OnOK() 
{
  DlgDirSelect(m_pszFile, LETTERTEMPLATE_FILES);
	
	CDialog::OnOK();
}
int TFileOpen::doCommands(int Command, HWND hWndSource, UINT Notification)
{         
        switch(Command)
        {
                case id_FName:
                        if (Notification == EN_CHANGE)
                                EnableWindow(GetDlgItem(hWindow, IDOK),
                                        (WORD) SendMessage(hWndSource, WM_GETTEXTLENGTH, 0, 0));
                        return TRUE;

                case id_FList:
                        switch(Notification)
                        {
                                case LBN_DBLCLK:
                                        PostMessage(hWindow, WM_COMMAND, IDOK, 0);
					return TRUE;
				
                                case LBN_SELCHANGE:
                                        DlgDirSelect(hWindow, pathName, id_FList);
                                        updateFileName();
                                        return TRUE;

                                case LBN_KILLFOCUS:
                                        SendMessage(hWndSource, LB_SETCURSEL, -1, 0);
                                        return TRUE;
                        }
                case id_DList:
                        switch(Notification)
                        {
				case LBN_DBLCLK:
					updateListBoxes();
					return TRUE;
				case LBN_SELCHANGE:
					DlgDirSelect(hWindow, pathName, id_DList);
                                        strcat(pathName, fileSpec);
					updateFileName();
                                        return TRUE;
				case LBN_KILLFOCUS:
                                        SendMessage(hWndSource, LB_SETCURSEL, -1, 0);
                                        return TRUE;
                        }

                case id_Scribble:
                        strcat(strcpy(pathName,getFileFirst(pathName)), ScribbleExtension);
                        updateFileName();
                        return TRUE;
                case id_Graph:
                        strcat(strcpy(pathName,getFileFirst(pathName)), GraphExtension);
                        updateFileName();
                        return TRUE;
                case id_Text:
                        if (strcmp(getExtension(pathName),"."))
                        {
                                strcat(strcpy(pathName,getFileFirst(pathName)), ".TXT");
                                updateFileName();
                        }
                        return TRUE;
                default:
                        return TDialog::doCommands(Command, hWndSource, Notification);
        }
}