Exemplo n.º 1
0
void AP_Win32Dialog_SplitCells::runModeless(XAP_Frame * pFrame)
{
    // raise the dialog
    int iResult;
    XAP_Win32App * pWin32App = static_cast<XAP_Win32App *>(m_pApp);

    LPCTSTR lpTemplate = NULL;

    UT_return_if_fail (m_id == AP_DIALOG_ID_SPLIT_CELLS);

    lpTemplate = MAKEINTRESOURCE(AP_RID_DIALOG_SPLITCELLS);

    HWND hResult = CreateDialogParam(pWin32App->getInstance(),lpTemplate,
                                     static_cast<XAP_Win32FrameImpl*>(pFrame->getFrameImpl())->getTopLevelWindow(),
                                     (DLGPROC)s_dlgProc,(LPARAM)this);
    UT_ASSERT_HARMLESS((hResult != NULL));

    m_hwndDlg = hResult;

    // Save dialog the ID number and pointer to the widget
    UT_sint32 sid =(UT_sint32)  getDialogId();
    m_pApp->rememberModelessId( sid, (XAP_Dialog_Modeless *) m_pDialog);

    iResult = ShowWindow( m_hwndDlg, SW_SHOW );

    iResult = BringWindowToTop( m_hwndDlg );

    startUpdater();

    UT_ASSERT_HARMLESS((iResult != 0));

}
void AP_UnixDialog_FormatFrame::runModeless(XAP_Frame * pFrame)
{
	// Build the window's widgets and arrange them
	m_windowMain = _constructWindow();
	UT_return_if_fail(m_windowMain);

	// Populate the window's data items
	_populateWindowData();
	_connectSignals();
	abiSetupModelessDialog(GTK_DIALOG(m_windowMain), pFrame, this, BUTTON_CLOSE);
	
	// *** this is how we add the gc for Column Preview ***
	// attach a new graphics context to the drawing area
	UT_return_if_fail(m_wPreviewArea && m_wPreviewArea->window);

	// make a new Unix GC
	DELETEP (m_pPreviewWidget);
	GR_UnixCairoAllocInfo ai(m_wPreviewArea);
	m_pPreviewWidget = (GR_UnixCairoGraphics*) XAP_App::getApp()->newGraphics(ai);

	// Todo: we need a good widget to query with a probable
	// Todo: non-white (i.e. gray, or a similar bgcolor as our parent widget)
	// Todo: background. This should be fine
	m_pPreviewWidget->init3dColors(m_wPreviewArea->style);

	// let the widget materialize

	_createPreviewFromGC(m_pPreviewWidget,
						 static_cast<UT_uint32>(m_wPreviewArea->allocation.width),
						 static_cast<UT_uint32>(m_wPreviewArea->allocation.height));	
	
	m_pFormatFramePreview->draw();
	
	startUpdater();
}
void AP_UnixDialog_SplitCells::runModeless(XAP_Frame * pFrame)
{
	// Build the window's widgets and arrange them
	GtkWidget * mainWindow = _constructWindow();
	UT_return_if_fail(mainWindow);

	// Populate the window's data items
	_populateWindowData();
	_connectSignals();
	abiSetupModelessDialog(GTK_DIALOG(mainWindow),pFrame,this,BUTTON_CLOSE);
	startUpdater();
}
void AP_Win32Dialog_MergeCells::runModeless(XAP_Frame * pFrame)
{
 	UT_return_if_fail (pFrame);
	UT_return_if_fail (m_id == AP_DIALOG_ID_MERGE_CELLS);

	createModeless(pFrame, MAKEINTRESOURCEW(AP_RID_DIALOG_MERGECELLS));

	// Save dialog the ID number and pointer to the widget
	UT_sint32 sid =(UT_sint32)  getDialogId();
	m_pApp->rememberModelessId( sid, (XAP_Dialog_Modeless *) m_pDialog);

	startUpdater();
}
Exemplo n.º 5
0
void MainWindow::toggleStartStop()
{
    if(stream_->isActive()) { // if in progress
        stream_->stop();
        time_updater_.stop();
        ui->start_stop_->setText("Start");
        ui->elapsed_->setText("00:00:00");
    } else {
        if(stream_->start()) {
            QTimer::singleShot(100, this, SLOT(startUpdater()));
            ui->start_stop_->setText("Stop");
        }
    }
}
Exemplo n.º 6
0
void UpdateInfoPlugin::checkForUpdatesFinished()
{
    setLastCheckDate(QDate::currentDate());

    QDomDocument document;
    document.setContent(d->m_collectedOutput);

    stopCheckForUpdates();

    if (!document.isNull() && document.firstChildElement().hasChildNodes()) {
        emit newUpdatesAvailable(true);
        if (QMessageBox::question(0, tr("Updater"),
                                  tr("New updates are available. Do you want to start update?"))
                == QMessageBox::Yes)
            startUpdater();
    } else {
        emit newUpdatesAvailable(false);
    }
}
Exemplo n.º 7
0
void    QNetsoul::connectActionsSignals(void)
{
  // QNetsoul
  connect(actionConnect, SIGNAL(triggered()), SLOT(connectToServer()));
  connect(actionDisconnect, SIGNAL(triggered()), SLOT(disconnect()));
  connect(actionCheckForUpdates, SIGNAL(triggered()),
          this->_internUpdater, SLOT(startUpdater()));
  connect(actionQuit, SIGNAL(triggered()), SLOT(saveStateBeforeQuiting()));
  // Contacts
  connect(actionAddG, SIGNAL(triggered()), this->tree, SLOT(addGroup()));
  connect(actionAddC, SIGNAL(triggered()), this->tree, SLOT(addContact()));
  connect(actionRefresh, SIGNAL(triggered()),
          this->tree, SLOT(refreshContacts()));
  connect(actionLoadContacts, SIGNAL(triggered()),
          this->tree, SLOT(loadContacts()));
  connect(actionSaveContacts, SIGNAL(triggered()),
          this->tree, SLOT(saveContacts()));
  connect(actionSaveContactsAs, SIGNAL(triggered()),
          this->tree, SLOT(saveContactsAs()));
  // Plugins
  connect(actionPluginsManager, SIGNAL(triggered()),
          this->_pluginsManager, SLOT(show()));
  connect(actionVDM, SIGNAL(triggered()), this->_vdm, SLOT(getVdm()));
  connect(actionCNF, SIGNAL(triggered()), this->_cnf, SLOT(getFact()));
  connect(actionPastebin, SIGNAL(triggered()),
          this->_pastebin, SLOT(pastebinIt()));
  // Options
  connect(actionPreferences, SIGNAL(triggered()), SLOT(openOptionsDialog()));
  // Help
  connect(actionAbout_QNetSoul, SIGNAL(triggered()), SLOT(aboutQNetSoul()));
  connect(actionAbout_Qt, SIGNAL(triggered()), qApp, SLOT(aboutQt()));
  // Status
  connect(statusComboBox, SIGNAL(currentIndexChanged(int)),
          this->_network, SLOT(sendStatus(const int&)));
  // From Option widget
  connect(this->_options->mainWidget,
          SIGNAL(loginPasswordFilled()), SLOT(connectToServer()));
}
Exemplo n.º 8
0
// This handles the WM_INITDIALOG message for the top-level dialog.
BOOL AP_Win32Dialog_FormatTable::_onInitDialog(HWND hWnd, WPARAM wParam, LPARAM lParam)
{
    UT_uint32 w,h, i;
    RECT rect;
    int nItem;
    const XAP_StringSet * pSS = m_pApp->getStringSet();
    DWORD dwColor = GetSysColor(COLOR_BTNFACE);
    UT_RGBColor Color(GetRValue(dwColor),GetGValue(dwColor),GetBValue(dwColor));

    /* Localise controls*/
    _DSX(FORMATTABLE_BTN_CANCEL,		DLG_Close);
    _DSX(FORMATTABLE_BTN_APPLY,			DLG_Apply);
    _DS(FORMATTABLE_TEXT_BACKGROUND,	DLG_FormatTable_Color);
    _DS(FORMATTABLE_TEXT_PREVIEW,		DLG_FormatTable_Preview);
    _DS(FORMATTABLE_TEXT_BORDERS,		DLG_FormatTable_Borders);
    _DS(FORMATTABLE_TEXT_BORDER, 		DLG_FormatTable_Color);
    _DS(FORMATTABLE_TEXT_BACKGROUNDS, 	DLG_FormatTable_Background);
    _DS(FORMATTABLE_TEXT_APPLYTO,	 	DLG_FormatTable_Apply_To);
    _DS(FORMATTABLE_BUTTON_SELIMAGE,	DLG_FormatTable_SelectImage);
    _DS(FORMATTABLE_BUTTON_NOIMAGE,		DLG_FormatTable_NoImageBackground);
    _DS(FORMATTABLE_TEXT_THICKNESS,		DLG_FormatTable_Thickness);
    _DS(FORMATTABLE_TEXT_IMGBACK,		DLG_FormatTable_SetImageBackground);


    SetWindowText(hWnd, pSS->getValue(AP_STRING_ID_DLG_FormatTableTitle));


    /* Load the bitmaps into the dialog box */
    m_hBitmapBottom = _loadBitmap(hWnd,AP_RID_DIALOG_FORMATTABLE_BMP_BOTTOM, "FT_LINEBOTTOM",  BITMAP_WITDH, BITMAP_HEIGHT, Color);
    m_hBitmapTop = _loadBitmap(hWnd,AP_RID_DIALOG_FORMATTABLE_BMP_TOP, "FT_LINETOP",  BITMAP_WITDH, BITMAP_HEIGHT, Color);
    m_hBitmapRight = _loadBitmap(hWnd,AP_RID_DIALOG_FORMATTABLE_BMP_RIGHT, "FT_LINERIGHT",  BITMAP_WITDH, BITMAP_HEIGHT, Color);
    m_hBitmapLeft = _loadBitmap(hWnd,AP_RID_DIALOG_FORMATTABLE_BMP_LEFT, "FT_LINELEFT",  BITMAP_WITDH, BITMAP_HEIGHT, Color);

    /* Preview*/
    HWND hwndChild = GetDlgItem(hWnd, AP_RID_DIALOG_FORMATTABLE_STATIC_PREVIEW);
    UT_return_val_if_fail (hwndChild,0);

    delete m_pPreviewWidget;
    m_pPreviewWidget = new XAP_Win32PreviewWidget(static_cast<XAP_Win32App *>(m_pApp),  hwndChild, 0);
    m_pPreviewWidget->getGraphics()->init3dColors();
    m_pPreviewWidget->getWindowSize(&w,&h);
    _createPreviewFromGC(m_pPreviewWidget->getGraphics(), w, h);
    m_pPreviewWidget->setPreview(m_pFormatTablePreview);


    startUpdater();
    setAllSensitivities();

    /* Default status for the push bottons*/
    CheckDlgButton(m_hwndDlg, AP_RID_DIALOG_FORMATTABLE_BMP_TOP, getTopToggled() ? BST_CHECKED: BST_UNCHECKED);
    CheckDlgButton(m_hwndDlg, AP_RID_DIALOG_FORMATTABLE_BMP_BOTTOM, getBottomToggled() ? BST_CHECKED: BST_UNCHECKED);
    CheckDlgButton(m_hwndDlg, AP_RID_DIALOG_FORMATTABLE_BMP_RIGHT, getRightToggled() ? BST_CHECKED: BST_UNCHECKED);
    CheckDlgButton(m_hwndDlg, AP_RID_DIALOG_FORMATTABLE_BMP_LEFT, getLeftToggled() ? BST_CHECKED: BST_UNCHECKED);

    /* Combo Values for Applyto*/
    HWND hCombo = GetDlgItem(hWnd, AP_RID_DIALOG_FORMATTABLE_COMBO_APPLYTO);

    nItem = SendMessage(hCombo, CB_ADDSTRING, 0, (WPARAM) pSS->getValue(AP_STRING_ID_DLG_FormatTable_Apply_To_Selection));
    SendMessage(hCombo, CB_SETITEMDATA, nItem, FORMAT_TABLE_SELECTION);

    nItem = SendMessage(hCombo, CB_ADDSTRING, 0, (WPARAM) pSS->getValue(AP_STRING_ID_DLG_FormatTable_Apply_To_Row));
    SendMessage(hCombo, CB_SETITEMDATA, nItem, FORMAT_TABLE_ROW);

    nItem = SendMessage(hCombo, CB_ADDSTRING, 0, (WPARAM) pSS->getValue(AP_STRING_ID_DLG_FormatTable_Apply_To_Column));
    SendMessage(hCombo, CB_SETITEMDATA, nItem, FORMAT_TABLE_COLUMN);

    nItem = SendMessage(hCombo, CB_ADDSTRING, 0, (WPARAM) pSS->getValue(AP_STRING_ID_DLG_FormatTable_Apply_To_Table));
    SendMessage(hCombo, CB_SETITEMDATA, nItem, FORMAT_TABLE_TABLE);

    SendMessage(hCombo, CB_SETCURSEL, 0, 0);

    /* Combo Values for Thickness */
    hCombo = GetDlgItem(hWnd, AP_RID_DIALOG_FORMATTABLE_COMBO_THICKNESS);

    for(i=0; i < FORMAT_TABLE_NUMTHICKNESS ; i++)
        SendMessage(hCombo, CB_ADDSTRING, 0, (WPARAM) sThicknessTable[i]);

    SendMessage(hCombo, CB_SETCURSEL, 0, 0);



    XAP_Win32DialogHelper::s_centerDialog(hWnd);
    return 1;
}
// This handles the WM_INITDIALOG message for the top-level dialog.
BOOL AP_Win32Dialog_FormatFrame::_onInitDialog(HWND hWnd, WPARAM /*wParam*/, LPARAM /*lParam*/)
{	
	HDC hdc;
	int x, y;	
	UT_uint32 w,h;
	UT_sint32 i = 0;
	RECT rect;	
	const XAP_StringSet * pSS = m_pApp->getStringSet();
	DWORD dwColor = GetSysColor(COLOR_BTNFACE);	
	UT_RGBColor Color(GetRValue(dwColor),GetGValue(dwColor),GetBValue(dwColor));
	
	/* The four items are the same size */
	GetClientRect(GetDlgItem(hWnd, AP_RID_DIALOG_FORMATFRAME_BMP_BOTTOM), &rect);					
	hdc = GetDC(hWnd);
	x = rect.right - rect.left;
	y = rect.bottom - rect.top;
	
	/* Localise controls*/
	_DSX(FORMATFRAME_BTN_CANCEL,		DLG_Close);
	_DSX(FORMATFRAME_BTN_APPLY,			DLG_Apply);
	_DS(FORMATFRAME_TEXT_BACKGROUND,	DLG_FormatFrame_Color);
	_DS(FORMATFRAME_TEXT_PREVIEW,		DLG_FormatFrame_Preview);
	_DS(FORMATFRAME_TEXT_BORDERS,		DLG_FormatFrame_Border_Color);
	_DS(FORMATFRAME_TEXT_BORDER, 		DLG_FormatFrame_Color);
	_DS(FORMATFRAME_TEXT_BACKGROUNDS, 	DLG_FormatFrame_Background);
	_DS(FORMATFRAME_TEXT_TEXTWRAPS,		DLG_FormatFrame_TextWrapping);
	_DS(FORMATFRAME_CHK_TEXTWRAP,		DLG_FormatFrame_SetTextWrapping);
	_DS(FORMATFRAME_TEXT_POSTEXTPOS,	DLG_FormatFrame_PositionTo);
	_DS(FORMATFRAME_RADIO_PARA,		 	DLG_FormatFrame_SetToParagraph);
	_DS(FORMATFRAME_RADIO_COLUMN,		DLG_FormatFrame_SetToColumn);
	_DS(FORMATFRAME_RADIO_PAGE,			DLG_FormatFrame_SetToPage);
	_DS(FORMATFRAME_BUTTON_SELIMAGE,	DLG_FormatFrame_SelectImage);
	_DS(FORMATFRAME_BUTTON_NOIMAGE,		DLG_FormatFrame_NoImageBackground);
	_DS(FORMATFRAME_TEXT_THICKNESS,		DLG_FormatTable_Thickness);
	_DS(FORMATFRAME_TEXT_IMGBACK,		DLG_FormatFrame_SetImageBackground);


	setDialogTitle (pSS->getValue(AP_STRING_ID_DLG_FormatFrameTitle));	
	
	
	/* Load the bitmaps into the dialog box */								
    m_hBitmapBottom = _loadBitmap(hWnd,AP_RID_DIALOG_FORMATFRAME_BMP_BOTTOM, "FT_LINEBOTTOM",  BITMAP_WITDH, BITMAP_HEIGHT, Color);
    m_hBitmapTop = _loadBitmap(hWnd,AP_RID_DIALOG_FORMATFRAME_BMP_TOP, "FT_LINETOP",  BITMAP_WITDH, BITMAP_HEIGHT, Color);
    m_hBitmapRight = _loadBitmap(hWnd,AP_RID_DIALOG_FORMATFRAME_BMP_RIGHT, "FT_LINERIGHT",  BITMAP_WITDH, BITMAP_HEIGHT, Color);
    m_hBitmapLeft = _loadBitmap(hWnd,AP_RID_DIALOG_FORMATFRAME_BMP_LEFT, "FT_LINELEFT",  BITMAP_WITDH, BITMAP_HEIGHT, Color); 
    
	/* Preview*/
	HWND hwndChild = GetDlgItem(hWnd, AP_RID_DIALOG_FORMATFRAME_STATIC_PREVIEW);	
	UT_return_val_if_fail (hwndChild,1);

	m_pPreviewWidget = new XAP_Win32PreviewWidget(static_cast<XAP_Win32App *>(m_pApp),  hwndChild, 0);	
	m_pPreviewWidget->getGraphics()->init3dColors();
	m_pPreviewWidget->getWindowSize(&w,&h);
	_createPreviewFromGC(m_pPreviewWidget->getGraphics(), w, h);	
	m_pPreviewWidget->setPreview(m_pFormatFramePreview); 	
								
	startUpdater();
	setAllSensitivities();

	/* Default status for the dialog controls */
	CheckDlgButton(hWnd, AP_RID_DIALOG_FORMATFRAME_BMP_TOP, getTopToggled() ? BST_CHECKED: BST_UNCHECKED);
	CheckDlgButton(hWnd, AP_RID_DIALOG_FORMATFRAME_BMP_BOTTOM, getBottomToggled() ? BST_CHECKED: BST_UNCHECKED);
	CheckDlgButton(hWnd, AP_RID_DIALOG_FORMATFRAME_BMP_RIGHT, getRightToggled() ? BST_CHECKED: BST_UNCHECKED);
	CheckDlgButton(hWnd, AP_RID_DIALOG_FORMATFRAME_BMP_LEFT, getLeftToggled() ? BST_CHECKED: BST_UNCHECKED);

	/* Position to radio buttons */
	if(positionMode() == FL_FRAME_POSITIONED_TO_BLOCK)
	{
		CheckRadioButton(hWnd, AP_RID_DIALOG_FORMATFRAME_RADIO_PARA, AP_RID_DIALOG_FORMATFRAME_RADIO_PAGE, AP_RID_DIALOG_FORMATFRAME_RADIO_PARA);
	}
	else if(positionMode() == FL_FRAME_POSITIONED_TO_COLUMN)
	{
		CheckRadioButton(hWnd, AP_RID_DIALOG_FORMATFRAME_RADIO_PARA, AP_RID_DIALOG_FORMATFRAME_RADIO_PAGE, AP_RID_DIALOG_FORMATFRAME_RADIO_COLUMN);
	}
	else if(positionMode() == FL_FRAME_POSITIONED_TO_PAGE)
	{
		CheckRadioButton(hWnd, AP_RID_DIALOG_FORMATFRAME_RADIO_PARA, AP_RID_DIALOG_FORMATFRAME_RADIO_PAGE, AP_RID_DIALOG_FORMATFRAME_RADIO_PAGE);
	}

	/* Wrapping checkbox */
	CheckDlgButton(hWnd, AP_RID_DIALOG_FORMATFRAME_CHK_TEXTWRAP, getWrapping() ? BST_CHECKED: BST_UNCHECKED);

	/* Combo Values for Thickness */
	
	for(i=0; i < FORMAT_FRAME_NUMTHICKNESS ;i++)
		addItemToCombo (AP_RID_DIALOG_FORMATFRAME_COMBO_THICKNESS, sThickness[i]);

	selectComboItem (AP_RID_DIALOG_FORMATFRAME_COMBO_THICKNESS, 0);

	centerDialog();
	return 1; 
}