void GraphicsClientItem::toggleControls(bool ensureVisible_)
{
    if (controlsItem) {
        setFocus();
        // show the inner item if requested:
        setControlsVisible(ensureVisible_ || !controlsItem->isVisible());
    }
}
Exemple #2
0
Ascii2Dialog::Ascii2Dialog( Window *frame, Window *parent ) :
  Dialog( frame, parent, "",
          NOTITLE,
          0, 0, frame->getClientWidth(), frame->getClientHeight() - Notebook::getTabInset() )
{
  getGraphics()->setDialogFont();

  int margin = 10, fontHeight = fontHeight = Graphics::dialogDesignFontHeight,
      yStart = getClientHeight() - fontHeight,
      interSpace = fontHeight + fontHeight / 2,
      labelHeight = fontHeight + fontHeight / 3;

	int top = yStart;

  int editBoxHeight = EntryField::getInset() * 2 + fontHeight + 2;

	yStart -= fontHeight * 3;

  lineNumbersCheck  = new CheckBox( this, Strings::get(210),
                                         NEWGROUP|ISTABSTOP, 20, yStart, 150,
                                         fontHeight*2 );

  savedPositionsCheck  = new CheckBox( this, Strings::get(211),
                                         INGROUP, 180, yStart, 150,
                                         fontHeight*2 );

  yStart -= interSpace;

	Label *lbl = new Label( this, Label::RIGHT, Strings::get(213), 20,
                   yStart, 150, labelHeight );

	leftMarginCharsEntry = new EntryField( this, ISTABSTOP|BORDER, 180, yStart,
                                   	    130, editBoxHeight );
	
  yStart -= fontHeight / 2;

  GroupBox *gBox = new GroupBox( this, Strings::get(212), 0, 10, yStart,
                                 360, top - yStart );

	if( Settings::showLineNumbers )
		lineNumbersCheck->check( TRUE );

	if( Settings::showSavedPos )
		savedPositionsCheck->check( TRUE );

	char str[20];

	sprintf( str, "%d", Settings::leftMarginChars );
	leftMarginCharsEntry->setText( str );

	lineNumbersCheck->setFocus();

	setControlsVisible();		
}
Exemple #3
0
bool PictureContent::loadFromNetwork(const QString & url, QNetworkReply * reply, const QString & title, int width, int height)
{
    dropNetworkConnection();
    delete m_photo;
    m_cachedPhoto = QPixmap();
    m_opaquePhoto = false;
    m_photo = 0;
    m_fileUrl = url;
    m_netWidth = width;
    m_netHeight = height;

    // start a download if not passed as a paramenter
    if (!reply) {
        // the QNAM will be auto-deleted on closure
        QNetworkAccessManager * nam = new QNetworkAccessManager(this);
        QNetworkRequest request(url);
        m_netReply = nam->get(request);
    } else
        m_netReply = reply;

    // set title
    if (!title.isEmpty()) {
        setFrameTextEnabled(true);
        setFrameText(title);
    }

#if QT_VERSION >= 0x040600
    // Immediate Decode: just handle the reply if done
    if (m_netReply->isFinished())
        return slotLoadNetworkData();
#else
    // No Precaching ensures signals to be emitted later
#endif

    // Deferred Decode: listen to the network job
    setAcceptHoverEvents(false);
    setControlsVisible(false);
    m_progress = 0.01;
    connect(m_netReply, SIGNAL(finished()), this, SLOT(slotLoadNetworkData()));
    connect(m_netReply, SIGNAL(error(QNetworkReply::NetworkError)), this, SLOT(slotNetworkError()));
    connect(m_netReply, SIGNAL(downloadProgress(qint64,qint64)), this, SLOT(slotNetworkProgress(qint64,qint64)));

    // reset size, if got the network one
    if (m_netWidth > 0 && m_netHeight > 0)
        resetContentsRatio();
    return true;
}
Exemple #4
0
void FaceItem::setVisible(bool visible)
{
    d->faceMarquee->setVisible(visible);
    setControlsVisible(visible);
}
Exemple #5
0
EditorDialog::EditorDialog( Window *frame, Window *parent ) :
  Dialog( frame, parent, "",
          NOTITLE,
          0, 0, frame->getClientWidth(), frame->getClientHeight() - Notebook::getTabInset() )
{
  getGraphics()->setDialogFont();

  int margin = 10, fontHeight = Graphics::dialogDesignFontHeight,
      yStart = getClientHeight() - fontHeight,
      interSpace = fontHeight + fontHeight / 2;

  int editBoxHeight = EntryField::getInset() * 2 + fontHeight + 2;
  int editBoxInterSpace = editBoxHeight + fontHeight / 3,
      labelHeight = fontHeight + fontHeight / 3;

	int top = yStart;

	yStart -= fontHeight * 3;

  persistentBlocksCheck  = new CheckBox( this, Strings::get(180),
                                         NEWGROUP|ISTABSTOP, 20, yStart, 150,
                                         fontHeight*2 );

  useTabCheck  = new CheckBox( this, Strings::get(202),
                                         INGROUP, 180, yStart, 100,
                                         fontHeight*2 );

	yStart -= interSpace;

  optimalFillCheck  = new CheckBox( this, Strings::get(203),
                                         INGROUP, 20, yStart, 150,
                                         fontHeight*2 );

  virtualSpaceCheck  = new CheckBox( this, Strings::get(230),
                                         INGROUP, 180, yStart, 150,
                                         fontHeight*2 );

  yStart -= fontHeight / 2;

  GroupBox *gBox = new GroupBox( this, Strings::get(186), 0, 10, yStart,
                                 360, top - yStart );

  yStart -= fontHeight / 2;

  top = yStart;

  yStart -= fontHeight * 3;

	Label *lbl = new Label( this, Label::RIGHT, Strings::get(181), 20,
                   yStart, 150, labelHeight );

	tabSizeEntry = new EntryField( this, ISTABSTOP|NEWGROUP|BORDER|NUMERIC, 180, yStart,
                               	    50, editBoxHeight );
	
  yStart -= editBoxInterSpace;

	lbl = new Label( this, Label::RIGHT, Strings::get(183), 20,
                   yStart, 150, labelHeight );

	delimEntry = new EntryField( this, ISTABSTOP|BORDER, 180, yStart,
                               	    130, editBoxHeight );
	
  yStart -= editBoxInterSpace;

	lbl = new Label( this, Label::RIGHT, Strings::get(182), 20,
                   yStart, 150, labelHeight );

	maxUndoSizeEntry = new EntryField( this, ISTABSTOP|BORDER|NUMERIC, 180, yStart,
                               	    50, editBoxHeight );
	
  yStart -= fontHeight / 2;

  gBox = new GroupBox( this, Strings::get(187), 0, 
  										 10, yStart,
                       320, top - yStart );

  yStart -= fontHeight / 2;

  top = yStart;

  yStart -= fontHeight * 3;

  CRLFButton = new RadioButton( this, Strings::get(184),
                                            NEWGROUP|ISTABSTOP, 20, yStart, 70,
                                            fontHeight*2 );

  LFButton = new RadioButton( this, Strings::get(185),
                                            0, 100, yStart, 70,
                                            fontHeight*2 );
  yStart -= fontHeight / 2;

  gBox = new GroupBox( this, Strings::get(189), 0, 
  										 10, yStart,
                       180, top - yStart );

	char str[100];

	if( Settings::persistentBlocks )
		persistentBlocksCheck->check( TRUE );

	if( Settings::useTab )
		useTabCheck->check( TRUE );

	if( Settings::optimalFill )
		optimalFillCheck->check( TRUE );

	if( Settings::virtualSpace )
		virtualSpaceCheck->check( TRUE );

	sprintf( str, "%d", Settings::tabSize );
	tabSizeEntry->setText( str );

	char *delim = new char[strlen(Settings::standardDelim) * 2 + 1];

	int len = 0;

	for( int i = 0; i < strlen( Settings::standardDelim ); i++ )
	{
		if( Settings::standardDelim[i] == 0x9 )
		{
			delim[len++] = '\\';
			delim[len++] = 't';
		}
		else
		if( Settings::standardDelim[i] == '\\' )
		{
			delim[len++] = '\\';
			delim[len++] = '\\';
		}
		else
			delim[len++] = Settings::standardDelim[i];
	}

	delim[len] = 0;

	delimEntry->setText( delim );

	delete delim;

	sprintf( str, "%d", Settings::maxUndoSize / 1024 );
	maxUndoSizeEntry->setText( str );

	if( Settings::CRLF )
		CRLFButton->check(TRUE);
	else
		LFButton->check(TRUE);

	persistentBlocksCheck->setFocus();

	setControlsVisible();		
}
Exemple #6
0
PrefsDialog::PrefsDialog( Window *frame, Window *parent ) :
  Dialog( frame, parent, Strings::get( 168 ),
          AWindow::CENTER | AWindow::ISMODAL | AWindow::ADJUSTSIZE,
          0, 0, 500, 365 )
{
  char *namestr = "PrefsDialog";
  name = new char[strlen(namestr)+1];
  strcpy( name, namestr );

  getGraphics()->setDialogFont();

  int margin = 10, fontHeight = Graphics::dialogDesignFontHeight,
      yStart = getClientHeight() - fontHeight*2 - 20,
      interSpace = fontHeight + fontHeight / 2;

  prevUseBigFont = AGraphics::useBigFont;

  Notebook *notebook =
	  new Notebook( this, 0, 50, getClientWidth(), getClientHeight() - 50, 
		              Color::BKGR, 0 );

	asciiDialog = new AsciiDialog( notebook, notebook );
	ascii2Dialog = new Ascii2Dialog( notebook, notebook );
	hexDialog = new HexDialog( notebook, notebook );
	editorDialog = new EditorDialog( notebook, notebook );
	displayDialog = new DisplayDialog( notebook, notebook );
	miscDialog = new MiscDialog( notebook, notebook );

	notebook->add( editorDialog, Strings::get(188) );
	notebook->add( displayDialog, Strings::get(190) );
	notebook->add( asciiDialog, Strings::get(166) );
	notebook->add( ascii2Dialog, Strings::get(209) );
	notebook->add( hexDialog, Strings::get(179) );
	notebook->add( miscDialog, Strings::get(196) );

  OKButton = new Button( this, Strings::get(8), AWindow::ISDEFAULT|ISTABSTOP,
                             10, 10, 70, 30 );
  OKButton->setYMove( FOLLOW );

  cancelButton = new Button( this, Strings::get(9), ISTABSTOP, 90, 10, 70, 30 );
  cancelButton->setYMove( FOLLOW );

	setControlsVisible();
  notebook->setTab( 0 );

  OKButton->addButtonListener( this );
  cancelButton->addButtonListener( this );

  adjustForFontSize();

  // Save/restore window position

  initSize();

  int x = getX(), y = getY(), width = getWidth(), height = getHeight();
  WinProperties::retrieveProperty( name, x, y, width, height );

  setSize( width, height );
  center( x, y );
  setPos( x, y );
}
Exemple #7
0
HexDialog::HexDialog( Window *frame, Window *parent ) :
  Dialog( frame, parent, "",
          NOTITLE,
          0, 0, frame->getClientWidth(), frame->getClientHeight() - Notebook::getTabInset() )
{
  getGraphics()->setDialogFont();

  int margin = 10, fontHeight = Graphics::dialogDesignFontHeight,
      yStart = getClientHeight() - fontHeight,
      interSpace = fontHeight + fontHeight / 2;

  int editBoxHeight = EntryField::getInset() * 2 + fontHeight + 2;
  int editBoxInterSpace = editBoxHeight + fontHeight / 3,
      labelHeight = fontHeight + fontHeight / 3;

	int top = yStart;

  yStart -= fontHeight * 2 + fontHeight / 2;

	int top2 = yStart;

	Label *lbl = new Label( this, Label::LEFT, Strings::get(129), 20,
                    yStart, 50, labelHeight );

	fontCombo = new SComboBox( this, ISTABSTOP|SComboBox::STATIC, 20, yStart,
                            240, editBoxHeight, 100 );

  int comboHeight = fontCombo->getEditBoxHeight();
  yStart -= comboHeight + comboHeight / 2;
  fontCombo->setPos( fontCombo->getX(), yStart);

	yStart = top2;

	lbl = new Label( this, Label::LEFT, Strings::get(130), 270,
                    yStart, 50, labelHeight );

  yStart -= comboHeight + comboHeight / 2;

	sizeCombo = new SComboBox( this, ISTABSTOP|NUMERIC, 270, yStart,
                            	      80, editBoxHeight, 100 );
  sizeCombo->setMaxLength( 5 );

  yStart -= fontHeight*2;

  bitmapFontsCheck = new CheckBox( this, Strings::get(167),
                                   ISTABSTOP, 20, yStart, 150,
                                   fontHeight*2 );

  yStart -= fontHeight / 2;

  GroupBox *gBox = new GroupBox( this, Strings::get(128), 0, 10, yStart,
                                 360, top - yStart );

  yStart -= fontHeight / 2;

  top = yStart;

	fontPreviewWindow = new FontPreviewWindow( this, width - 220, (top-10-70) / 2, 200, 70 );
  fontPreviewWindow->setWMove( FOLLOW );
  fontPreviewWindow->setHMove( FOLLOW );

	if( Settings::hexFont == NULL )
	{
		Settings::hexFont = new char[strlen(Graphics::getHexEditorFontName())+1];
		strcpy( Settings::hexFont, Graphics::getHexEditorFontName());
		Settings::hexFontSizeP = Graphics::getHexEditorFontSize();
	}

	fontPreviewWindow->selectFont( getGraphics()->getFontFromName( Settings::hexFont, 0 ), 
	                               -1, -1, Settings::hexFontSizeP );


  yStart -= fontHeight * 3;

  numericInfoCheck = new CheckBox( this, Strings::get(231), ISTABSTOP, 20, yStart, 150, fontHeight * 2 );

  yStart -= interSpace;

  linesHexCheck = new CheckBox( this, Strings::get(246), ISTABSTOP, 20, yStart, width-280, fontHeight * 2 );

  yStart -= interSpace;

  hideAscii32Check = new CheckBox( this, Strings::get(254), ISTABSTOP, 20, yStart, width-280, fontHeight * 2 );

	yStart -= fontHeight / 2;

  gBox = new GroupBox( this, Strings::get(232), 0, 10, yStart, width-260, top - yStart );

	// Fill in fonts

	char numstr[30];
	int i;

	FontList *fonts = getGraphics()->getFonts();

	for( i = 0; i < fonts->fonts; i++ )
		if( fonts->font[i].monoSpaced )
			fontCombo->addItem( fonts->font[i].name );

	fontCombo->addSelectionListener(this);

  if( Settings::hexFontSizeP != -1 )
		sprintf( numstr, "%d", Settings::hexFontSizeP );
	else
		sprintf( numstr, "%dx%d", Settings::hexFontSizeX, 
             Settings::hexFontSizeY );

	sizeCombo->addSelectionListener(this);

	fontCombo->setText( Settings::hexFont  );

	sizeCombo->setText( numstr );

  fontCombo->setFocus();

  numericInfoCheck->check( Settings::showBytesInfo );
  linesHexCheck->check( Settings::linesInHex );
  hideAscii32Check->check( Settings::hideAscii32 );

	bitmapFontsCheck->addButtonListener(this);

	updateControlPos( NULL );

	setControlsVisible();		
}
Exemple #8
0
AsciiDialog::AsciiDialog( Window *frame, Window *parent ) :
  Dialog( frame, parent, "",
          NOTITLE,
          0, 0, frame->getClientWidth(), frame->getClientHeight() - Notebook::getTabInset() )
{
  getGraphics()->setDialogFont();

  int margin = 10, fontHeight = Graphics::dialogDesignFontHeight,
      yStart = getClientHeight() - fontHeight,
      interSpace = fontHeight + fontHeight / 2,
      labelHeight = fontHeight + fontHeight / 3;

  int editBoxHeight = EntryField::getInset() * 2 + fontHeight + 2;
  int editBoxInterSpace = editBoxHeight + fontHeight / 3;

	int top = yStart;

  yStart -= fontHeight * 2 + fontHeight / 2;

	int top2 = yStart;

	Label *lbl = new Label( this, Label::LEFT, Strings::get(129), 20,
                    yStart, 50, labelHeight );

	fontCombo = new SComboBox( this, ISTABSTOP|SComboBox::STATIC, 20, yStart,
                            240, editBoxHeight, 100 );

  int comboHeight = fontCombo->getEditBoxHeight();
  yStart -= comboHeight + comboHeight / 2;
  fontCombo->setPos( fontCombo->getX(), yStart);
  //lbl->setSize( lbl->getWidth(), comboHeight);
  //lbl->setPos( lbl->getX(), yStart);

	yStart = top2;

	lbl = new Label( this, Label::LEFT, Strings::get(130), 270,
                    yStart, 50, labelHeight );

  yStart -= comboHeight + comboHeight / 2;

	sizeCombo = new SComboBox( this, ISTABSTOP|NUMERIC, 270, yStart,
                            	      80, editBoxHeight, 100 );
  sizeCombo->setMaxLength( 5 );
  yStart -= fontHeight*2;

  fixedWidthOnlyCheck  = new CheckBox( this, Strings::get(131),
                                       ISTABSTOP, 20, yStart, 150,
                                       fontHeight*2 );

  bitmapFontsCheck  = new CheckBox( this, Strings::get(167),
                                    ISTABSTOP, 190, yStart, 150,
                                    fontHeight*2 );

  yStart -= fontHeight / 2;

  GroupBox *gBox = new GroupBox( this, Strings::get(128), 0, 10, yStart,
                                 360, top - yStart );

  yStart -= fontHeight / 2;

  top = yStart;

  yStart -= fontHeight * 2 + 15;

	lbl = new Label( this, Label::RIGHT, Strings::get(171), 20,
                    yStart, 90, labelHeight );

	textItemCombo = new SComboBox( this, ISTABSTOP|SComboBox::STATIC, 120, yStart,
                            	      width - 380, editBoxHeight, 100 );

  yStart -= interSpace;

  fgButton = new RadioButton( this, Strings::get(169),
                              NEWGROUP | ISTABSTOP, 20, yStart, 100,
                              interSpace );

  bgButton = new RadioButton( this, Strings::get(170),
                              INGROUP, 130, yStart, 100,
                              interSpace );


  yStart -= fontHeight/4 + 60;

	colorSet = new ValueSet( this, ISTABSTOP, 20, yStart, width - 280, fontHeight * 3.5, 10, 2, ValueSet::RGBCOLOR );

	yStart -= fontHeight;

  gBox = new GroupBox( this, Strings::get(128), 0, 10, yStart, width-260, top - yStart );

	colors[0] = Color::BLACK;
	colors[1] = Color::GRAY;
	colors[2] = Color::DARKRED;
	colors[3] = Color::BROWN;
	colors[4] = Color::DARKGREEN;
	colors[5] = Color::DARKCYAN;
	colors[6] = Color::DARKBLUE;
	colors[7] = Color::DARKPINK;
	colors[8] = Color::LIGHT;
	colors[9] = Color::SHADOW;
	colors[10] = Color::WHITE;
	colors[11] = Color::LIGHTGRAY;
	colors[12] = Color::RED;
	colors[13] = Color::YELLOW;
	colors[14] = Color::GREEN;
	colors[15] = Color::CYAN;
	colors[16] = Color::BLUE;
	colors[17] = Color::PINK;
	colors[18] = Color::BKGR;
	colors[19] = Color::DEFAULT;

	for( int yy = 0; yy < 2; yy++ )
		for( int xx = 0; xx < 10; xx++ )
			colorSet->setColor( xx, yy, colors[yy*10+xx] );

	colorSet->setVisible(TRUE);

	fontPreviewWindow = new FontPreviewWindow( this, width - 220, (top-10-70) / 2, 200, 70 );
  fontPreviewWindow->setWMove( FOLLOW );
  fontPreviewWindow->setHMove( FOLLOW );

	if( Settings::asciiFont == NULL )
	{
		Settings::asciiFont = new char[strlen(Graphics::getEditorFontName())+1];
		strcpy( Settings::asciiFont, Graphics::getEditorFontName());
		Settings::asciiFontSizeP = Graphics::getEditorFontSize();
	}

	fontPreviewWindow->selectFont( getGraphics()->getFontFromName( Settings::asciiFont, 0 ), 
	                               -1, -1, Settings::asciiFontSizeP );

	// Fill in fonts

	char numstr[30];
	int i;

	FontList *fonts = getGraphics()->getFonts();

	for( i = 0; i < fonts->fonts; i++ )
		if( (Settings::asciiFixedWidthOnly && fonts->font[i].monoSpaced) || 
				!Settings::asciiFixedWidthOnly  )
			fontCombo->addItem( fonts->font[i].name );

	fontCombo->addSelectionListener(this);

  if( Settings::asciiFontSizeP != -1 )
		sprintf( numstr, "%d", Settings::asciiFontSizeP );
	else
		sprintf( numstr, "%dx%d", Settings::asciiFontSizeX, 
             Settings::asciiFontSizeY );

	sizeCombo->addSelectionListener(this);

	if( Settings::asciiFixedWidthOnly )
		fixedWidthOnlyCheck->check(TRUE);	

	textItemCombo->addItem( Strings::get( 172 ) );
	textItemCombo->addItem( Strings::get( 173 ) );
	textItemCombo->addItem( Strings::get( 174 ) );
  textItemCombo->addItem( Strings::get( 214 ) );
  textItemCombo->addItem( Strings::get( 215 ) );
  textItemCombo->setText( Strings::get( 172 ) );

	textItemCombo->addSelectionListener( this );

	fontCombo->setText( Settings::asciiFont  );

	textFg = Settings::textFg;
	textBg = Settings::textBg;
	markFg = Settings::markFg;
	markBg = Settings::markBg;
	hiliteFg = Settings::hiliteFg;
	hiliteBg = Settings::hiliteBg;
	markerFg = Settings::markerFg;
	markerBg = Settings::markerBg;
	leftMarginFg = Settings::leftMarginFg;
	leftMarginBg = Settings::leftMarginBg;

  currentColorSet = -1;
  currentCp = 0;

  setColor( textFg );

	fgButton->check(TRUE);

	sizeCombo->setText( numstr );

  fontCombo->setFocus();

	fixedWidthOnlyCheck->addButtonListener(this);
	bitmapFontsCheck->addButtonListener(this);
	fgButton->addButtonListener(this);
	bgButton->addButtonListener(this);
	colorSet->addSelectionListener( this );
	
	updateControlPos( NULL );

	setControlsVisible();		
}
Exemple #9
0
MiscDialog::MiscDialog( Window *frame, Window *parent ) :
  Dialog( frame, parent, "",
          NOTITLE,
          0, 0, frame->getClientWidth(), frame->getClientHeight() - Notebook::getTabInset() )
{
  getGraphics()->setDialogFont();

  int margin = 10, fontHeight = fontHeight = Graphics::dialogDesignFontHeight,
      yStart = getClientHeight() - fontHeight,
      interSpace = fontHeight + fontHeight / 2,
      labelHeight = fontHeight + fontHeight / 3;

  int editBoxHeight = EntryField::getInset() * 2 + fontHeight + 2;

	int top = yStart;

	yStart -= fontHeight * 3;

  backupFilesCheck  = new CheckBox( this, Strings::get(198),
                                         NEWGROUP|ISTABSTOP, 20, yStart, 150,
                                         fontHeight*2 );

  useSystemFileDialogCheck  = new CheckBox( this, Strings::get(204),
                                         INGROUP, 180, yStart, 150,
                                         fontHeight*2 );

  yStart -= interSpace;

  useBigFontCheck  = new CheckBox( this, Strings::get(207),
                                         INGROUP, 20, yStart, 150,
                                         fontHeight*2 );

  autoCloseFrameWindowCheck  = new CheckBox( this, Strings::get(216),
                                         INGROUP, 180, yStart, 170,
                                         fontHeight*2 );

  yStart -= interSpace;

  showCommandBarCheck  = new CheckBox( this, Strings::get(220),
                                         INGROUP, 20, yStart, 150,
                                         fontHeight*2 );

  reuseExistingBufferCheck = new CheckBox( this, Strings::get(233),
                                         INGROUP, 180, yStart, 170,
                                         fontHeight*2 );

  yStart -= interSpace;

  showToolbarCheck = new CheckBox( this, Strings::get(253),
                                         INGROUP, 20, yStart, 170,
                                         fontHeight*2 );

  yStart -= interSpace;

  queryUnicodeCheck  = new CheckBox( this, Strings::get(240),
                                         INGROUP, 20, yStart, 250,
                                         fontHeight*2 );
  yStart -= fontHeight / 2;

  GroupBox *gBox = new GroupBox( this, Strings::get(186), 0, 10, yStart,
                                 360, top - yStart );

  yStart -= fontHeight / 2;

  top = yStart;

  yStart -= fontHeight * 3;

  autoSaveCheck  = new CheckBox( this, Strings::get(200),
                                         ISTABSTOP, 20, yStart, 150,
                                         fontHeight*2 );

  yStart -= interSpace;

	Label *lbl = new Label( this, Label::RIGHT, Strings::get(201), 20,
                   yStart, 150, labelHeight );

	autosaveDelayEntry = new EntryField( this, ISTABSTOP|BORDER, 180, yStart,
                               	    130, editBoxHeight );
	
  yStart -= fontHeight / 2;

  gBox = new GroupBox( this, Strings::get(199), 0, 
  										 10, yStart,
                       320, top - yStart );

	char str[100];

	if( Settings::backupFiles )
		backupFilesCheck->check( TRUE );

	if( Settings::autoSave )
		autoSaveCheck->check( TRUE );

	if( Settings::useSystemFileDialog )
		useSystemFileDialogCheck->check( TRUE );

  if( Settings::autoCloseFrameWindow )
		autoCloseFrameWindowCheck->check( TRUE );

  if( Settings::reuseExistingBuffer )
		reuseExistingBufferCheck->check( TRUE );

  if( Settings::showCommandBar )
    showCommandBarCheck->check( TRUE );
    
  if( Settings::showToolbar )
		showToolbarCheck->check( TRUE );

 	queryUnicodeCheck->check( Settings::queryIfUnicode );

	if( AGraphics::useBigFont )
		useBigFontCheck->check( TRUE );

	sprintf( str, "%d", Settings::autosaveDelay );
	autosaveDelayEntry->setText( str );

	backupFilesCheck->setFocus();

	setControlsVisible();
}
Exemple #10
0
DisplayDialog::DisplayDialog( Window *frame, Window *parent ) :
  Dialog( frame, parent, "",
          NOTITLE,
          0, 0, frame->getClientWidth(), frame->getClientHeight() - Notebook::getTabInset() )
{
  getGraphics()->setDialogFont();

  int margin = 10, fontHeight = fontHeight = Graphics::dialogDesignFontHeight,
      yStart = getClientHeight() - fontHeight,
      interSpace = fontHeight + fontHeight / 2,
      labelHeight = fontHeight + fontHeight / 3;

  int editBoxHeight = EntryField::getInset() * 2 + fontHeight + 2;

	int top = yStart;

	yStart -= fontHeight * 3;

  syntaxHighlightCheck  = new CheckBox( this, Strings::get(192),
                                         ISTABSTOP, 20, yStart, 150,
                                         fontHeight*2 );

  showSectionsCheck  = new CheckBox( this, Strings::get(248),
                                     ISTABSTOP, 180, yStart, 150,
                                     fontHeight*2 );

  yStart -= interSpace;

  autogenSectionsCheck  = new CheckBox( this, Strings::get(249),
                                         ISTABSTOP, 20, yStart, 250,
                                         fontHeight*2 );

  yStart -= fontHeight / 2;

  GroupBox *gBox = new GroupBox( this, Strings::get(191), 0, 10, yStart,
                                 360, top - yStart );

  yStart -= fontHeight / 2;

  top = yStart;

  yStart -= fontHeight * 3;

  showRightMarginCheck  = new CheckBox( this, Strings::get(194),
                                         ISTABSTOP, 20, yStart, 150,
                                         fontHeight*2 );

  yStart -= interSpace;

	Label *lbl = new Label( this, Label::RIGHT, Strings::get(195), 20,
                   yStart, 150, labelHeight );

	rightMarginEntry = new EntryField( this, ISTABSTOP|BORDER, 180, yStart,
                               	    130, editBoxHeight );
	
  yStart -= fontHeight / 2;

  gBox = new GroupBox( this, Strings::get(187), 0, 
  										 10, yStart,
                       320, top - yStart );

	char str[100];

	if( Settings::syntaxHighlight )
		syntaxHighlightCheck->check( TRUE );

	if( Settings::showRightMargin )
		showRightMarginCheck->check( TRUE );

	if( Settings::showSectionBrowser )
		showSectionsCheck->check( TRUE );

	if( Settings::autogenerateSections )
		autogenSectionsCheck->check( TRUE );

	sprintf( str, "%d", Settings::rightMargin );
	rightMarginEntry->setText( str );

	syntaxHighlightCheck->setFocus();

	setControlsVisible();		
}
void AbstractContent::hoverLeaveEvent(QGraphicsSceneHoverEvent * /*event*/)
{
    setControlsVisible(false);
}
void AbstractContent::hoverEnterEvent(QGraphicsSceneHoverEvent * /*event*/)
{
    setControlsVisible(true);
}