Esempio n. 1
0
BOOL CALLBACK MainBoxCallback(HWND window,
                              UINT msg,
                              WPARAM param,
                              LPARAM param2) {
  switch(msg) {
    case WM_INITDIALOG:
      mainboxwindow = window;
      MainBoxDisplay(); // In this case, final touches to this window.
      ProgressBoxDisplay(); // Create the Progress Box at this time.
      return(FALSE); // And let Windows display this window.
      break;

    case WM_CLOSE: // The "X" in the upper right corner was hit.
      MainBoxCancelEvent();
      return(TRUE);
      break;

    case WM_COMMAND:
      // Do we wish to capture 'ENTER/RETURN' and/or 'ESC' here?

      switch(LOWORD(param)) {
        case IDC_0202: // Filename Edit Box
          MainBoxFileEvent(); // Describe the File's type...
          return(FALSE); // Let Windows handle the actual 'edit' processing...
          break;

        case IDC_0203: // "Browse" Button
          MainBoxBrowseEvent();
          return(TRUE);
          break;

        case IDC_0205: // "Ok" Button
          MainBoxOKEvent();
          return(TRUE);
          break;

        case IDC_0206: // "Get from Disc" Button
          MainBoxDeviceEvent();
          return(TRUE);
          break;

        case IDC_0207: // "Convert" Button
          MainBoxConversionEvent();
          return(TRUE);
          break;

        case IDC_0208: // "Cancel" Button
          MainBoxCancelEvent();
          return(TRUE);
          break;
      } // ENDSWITCH param- Which object got the message?
  } // ENDSWITCH msg- what message has been sent to this window?

  return(FALSE); // Not a recognized message? Tell Windows to handle it.
} // END MainBoxEventLoop()
Esempio n. 2
0
gint MainBoxOKEvent(GtkWidget *widget, GdkEvent event, gpointer data)
{
    const char *tempisoname;

    MainBoxUnfocus();

    tempisoname = gtk_entry_get_text(GTK_ENTRY(mainbox.file));
    if (*(tempisoname) != 0)
    {
        if (IsIsoFile(tempisoname) == -4)
        {
            IsoTableRebuild(tempisoname);
            MainBoxRefocus();
            return(TRUE);
        } // ENDIF- Do we need to rebuild an image file's index before using it?

        if (IsIsoFile(tempisoname) < 0)
        {
            tempisoname = NULL;
            MainBoxRefocus();
            MessageBoxShow("Not a Valid Image File.", 1);
            return(TRUE);
        } // ENDIF- Not an ISO file? Message and Stop here.
    } // ENDIF- Is there an ISO file to check out?

    strcpy(conf.isoname, tempisoname);
    tempisoname = NULL;
    if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(mainbox.startcheck)) == FALSE)
    {
        conf.startconfigure = 0; // FALSE
    }
    else
    {
        conf.startconfigure = 1; // TRUE
    } // ENDIF- Was this check button turned off?
    if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(mainbox.restartcheck)) == FALSE)
    {
        conf.restartconfigure = 0; // FALSE
    }
    else
    {
        conf.restartconfigure = 1; // TRUE
    } // ENDIF- Was this check button turned off?
    SaveConf();
    MainBoxCancelEvent(widget, event, data);
    return(TRUE);
} // END MainBoxOKEvent()
Esempio n. 3
0
gint MainBoxOKEvent(GtkWidget *widget, GdkEvent event, gpointer data) {

  const char *tempdevice;

  int retval;



  MainBoxUnfocus();



  tempdevice = gtk_entry_get_text(GTK_ENTRY(mainbox.device));

  strcpy(conf.devicename, tempdevice); // Temporarily put in new device name

  tempdevice = NULL;

  if(*(conf.devicename) != 0) {

    retval = DeviceOpen(); // Test by opening the device.

    DeviceClose(); // Failed or not, close it.

    if(retval != 0) {

      MainBoxRefocus();

      return(TRUE);

    } // ENDIF- Not an ISO file? Message and Stop here.

  } // ENDIF- Is there an ISO file to check out?



  SaveConf();



  MainBoxCancelEvent(widget, event, data);

  return(TRUE);

} // END MainBoxOKEvent()
Esempio n. 4
0
void MainBoxOKEvent()
{
	char tempisoname[256];
	MainBoxUnfocus();
	GetDlgItemText(mainboxwindow, IDC_0202, tempisoname, 256);
	if (*(tempisoname) != 0)
	{
		if (IsIsoFile(tempisoname) == -4)
		{
			IsoTableRebuild(tempisoname);
			MainBoxRefocus();
			return;
		} // ENDIF- Do we need to rebuild an image file's index before using it?
		if (IsIsoFile(tempisoname) < 0)
		{
			MainBoxRefocus();
			MessageBox(mainboxwindow,
			           "Not a Valid Image File.",
			           "CDVDisoEFP Message",
			           MB_OK | MB_ICONWARNING | MB_SETFOREGROUND);
			return;
		} // ENDIF- Not an ISO file? Message and Stop here.
	} // ENDIF- Do we have a name to check out?
	strcpy(conf.isoname, tempisoname);
	if (Button_GetCheck(GetDlgItem(mainboxwindow, IDC_0209)) == BST_UNCHECKED)
	{
		conf.startconfigure = 0; // FALSE
	}
	else
	{
		conf.startconfigure = 1; // TRUE
	} // ENDIF- Was this checkbox unchecked?
	if (Button_GetCheck(GetDlgItem(mainboxwindow, IDC_0210)) == BST_UNCHECKED)
	{
		conf.restartconfigure = 0; // FALSE
	}
	else
	{
		conf.restartconfigure = 1; // TRUE
	} // ENDIF- Was this checkbox unchecked?
	SaveConf();

	MainBoxCancelEvent();
	return;
} // END MainBoxOKEvent()
Esempio n. 5
0
void MainBoxOKEvent()
{
	int retval;
	MainBoxUnfocus();
	GetDlgItemText(mainboxwindow, IDC_0202, conf.devicename, 256);
	retval = DeviceOpen();
	DeviceClose();
	if (retval != 0) {
		MainBoxRefocus();
		MessageBox(mainboxwindow,
		           "Could not open the device",
		           "CDVDlinuz Message",
		           MB_OK | MB_ICONWARNING | MB_SETFOREGROUND);
		return;
	} // ENDIF- Trouble opening device? Abort here.
	SaveConf();
	MainBoxCancelEvent();
	return;
} // END MainBoxOKEvent()