Exemple #1
0
void Study1::leftPageCB(CCObject* pSender)
{
    if (current_page>0) {
        current_page--;
    }
    displayPage(current_page,false);
}
Exemple #2
0
void Gui::undo()
{
    macroNesting++;
    undoStack->undo();
    macroNesting--;
    displayPage();
}
void CSearchResultDlg::OnSearchPrev()
{
	if (--curPage <= 0)
		GetDlgItem(IDC_SEARCH_PREV)->EnableWindow(FALSE);
	m_ctlResult.DeleteAllItems();
	displayPage(curPage);
}
Exemple #4
0
void Gui::open()
{  
  if (maybeSave()) {
    QSettings settings(LPUB,SETTINGS);
    QString modelDir;
    if (settings.contains("modelDir")) {
      modelDir = settings.value("modelDir").toString();
    } else {
      modelDir = Preferences::ldrawPath + "/MODELS";
    }

    QString fileName = QFileDialog::getOpenFileName(
      this,
      tr("Open LDraw File"),
      modelDir,
      tr("LDraw Files (*.DAT *.LDR *.MPD *.dat *.ldr *.mpd)"));

    if (!fileName.isEmpty()) {
      settings.setValue("modelDir",modelDir);
      openFile(fileName);
      displayPage();
      enableActions();
      return;
    }
  }
  return;
}
Exemple #5
0
void Study1::rightPageCB(CCObject* pSender)
{
    int totalPages = (swfWords1.size() -1 )/ PAGE_CAPACITY ;
    if (current_page < totalPages) {
        current_page ++;
    }
    displayPage(current_page,false);
}
void BuildFontDialog::goPrevious()
{
  currentPage = currentPage - 1;
  if(currentPage < 0)
  {
    currentPage = 0;
  }
  displayPage();
}
Exemple #7
0
// **************************************************************************
// **************************************************************************
// pm <#>  Display page frame
int P4_dumpPageMemory(int argc, char* argv[])
{
	int page;

	printf("\nValidate arguments...");	// ?? validate arguments
	page = INTEGER(argv[1]);

	displayPage(page);
	return 0;
} // end P4_dumpPageMemory
void CSearchResultDlg::OnSearchAll() 
{
	CString str;
	str.Format(IDS_SEARCH_RESULT_ALL, pageCount);
	SetDlgItemText(IDC_STATUS, str);

	m_ctlResult.DeleteAllItems();
	for (int i = 0; i < pageCount; i++)
		displayPage(i, FALSE);
}
void BuildFontDialog::goNext()
{
  
  currentPage = currentPage + 1;
  if(currentPage >= doc->numPages())
  {
    currentPage = doc->numPages()-1;
  }
  displayPage();

}
Exemple #10
0
void CSearchResultDlg::onUserFound(PtrList *l)
{
	if (!l->empty()) {
		pages[pageCount++] = l;
		displayPage(++curPage);
		startUIN = ((SEARCH_RESULT *) l->back())->uin;
	} else {
		CString str;
		str.LoadString(IDS_SEARCH_NONE);
		SetDlgItemText(IDC_STATUS, str);
	}

	enableControls();
}
Exemple #11
0
void CSearchResultDlg::OnSearchNext() 
{
	m_ctlResult.DeleteAllItems();

	CString str;
	str.LoadString(IDS_SEARCHING_CONTACT);
	SetDlgItemText(IDC_STATUS, str);

	if (curPage < pageCount - 1) {
		if (curPage == 0)
			GetDlgItem(IDC_SEARCH_PREV)->EnableWindow();
		displayPage(++curPage);
		return;
	}

	CSearchWizard *wiz = (CSearchWizard *) GetParent();
	int mode = wiz->modeDlg.m_mode;
	const char *nick, *email;
	CString domain;
	uint16 seq = 0;

	switch (mode) {
	case SEARCH_MODE_RANDOM:
		seq = getUdpSession()->searchRandom(domain);
		break;

	case SEARCH_MODE_UIN:
		seq = getUdpSession()->searchUIN(wiz->uinDlg.m_qid);
		break;

	case SEARCH_MODE_CUSTOM:
		nick = wiz->customDlg.m_nick;
		email = wiz->customDlg.m_email;
		seq = getUdpSession()->searchCustom(nick, email, startUIN);
		break;

	case SEARCH_MODE_REMOTE:
		wiz->serverDlg.getServer(domain);
		seq = getUdpSession()->searchRandom(domain);
		break;
	}

	wiz->seq = seq;

	enableControls(FALSE);
}
BuildFontDialog::BuildFontDialog(Poppler::Document *pdf)
{

    doc = pdf;
    currentPage = 0;
    QPushButton *saveToFileButton = new QPushButton(tr("Save"));
    QPushButton *confirmButton = new QPushButton(tr("OK"));
    QPushButton *closeButton = new QPushButton(tr("Cancel"));
    connect(closeButton, SIGNAL(clicked()), this, SLOT(close()));
    connect(confirmButton, SIGNAL(clicked()), this, SLOT(testFun()));
    connect(saveToFileButton, SIGNAL(clicked()), this, SLOT(saveToFile()));

    imageLabel = new ImageLabel;
    imageLabel->setBackgroundRole(QPalette::Base);
    imageLabel->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Ignored);
    imageLabel->setScaledContents(true);
    scrollArea = new QScrollArea;
    scrollArea->setBackgroundRole(QPalette::Dark);
    scrollArea->setWidget(imageLabel);
    connect(imageLabel, SIGNAL(clicked(const QPoint & )), this, SLOT(pickLetter(const QPoint & )));
    
    QPushButton *previousButton = new QPushButton(tr("Previous"));
    QPushButton *nextButton = new QPushButton(tr("Next"));
    connect(previousButton, SIGNAL(clicked()), this, SLOT(goPrevious()));
    connect(nextButton, SIGNAL(clicked()), this, SLOT(goNext()));
    pageIndicator = new QLabel;
    QRadioButton *displayOriginal = new QRadioButton(tr("Original"));
    QRadioButton *displayBoxed = new QRadioButton(tr("Boxed"));
    isBoxedDisplay.addButton(displayOriginal);
    isBoxedDisplay.addButton(displayBoxed);
    displayOriginal->setChecked(true);
    
    selectionArbitrary = new QCheckBox();
    selectionArbitrary->setChecked(false);
    selectionArbitrary->setText("Arbitrary Rectangle");
    arbitraryLastPoint.setX(-1);
    
    connect(displayOriginal, SIGNAL(clicked()), this, SLOT(displayOriginalPage()));
    connect(displayBoxed, SIGNAL(clicked()), this, SLOT(displayBoxedPage()));

    QHBoxLayout *pageNavigationLayout = new QHBoxLayout;
    pageNavigationLayout->addStretch();
    pageNavigationLayout->addWidget(previousButton);
    pageNavigationLayout->addWidget(pageIndicator);
    pageNavigationLayout->addWidget(nextButton);
    pageNavigationLayout->addStretch();
    pageNavigationLayout->addWidget(selectionArbitrary);
    pageNavigationLayout->addStretch();
    pageNavigationLayout->addWidget(displayOriginal);
    pageNavigationLayout->addWidget(displayBoxed);
    pageNavigationLayout->addStretch();
    
    
    QHBoxLayout *lowerCases = new QHBoxLayout;
    QHBoxLayout *upperCases = new QHBoxLayout;
    buttonGroup= new QButtonGroup;
    createLetters(lowerCases, upperCases);
    connect(buttonGroup,SIGNAL(buttonClicked(QAbstractButton*)),this,SLOT(displayFontEditorFor(QAbstractButton*)));

    QVBoxLayout *lettersLayout = new QVBoxLayout;
    lettersLayout->addLayout(lowerCases);
    lettersLayout->addLayout(upperCases);
    
    QHBoxLayout *letterAdjustAndLetters = new QHBoxLayout;
    fontEditor = new NCSAFontEditor(&builtFont);
    letterAdjustAndLetters->addLayout(fontEditor);
    letterAdjustAndLetters->addLayout(lettersLayout);

    QHBoxLayout *testLayout = new QHBoxLayout;
    testInput = new QLineEdit;
    testDisplay = new QLabel;
    testLayout->addWidget(testInput);
    testLayout->addStretch();
    testLayout->addWidget(testDisplay);
    connect(testInput,SIGNAL(textChanged(QString)),this,SLOT(testInputChanged(QString)));
    
    QVBoxLayout *verticalLayout = new QVBoxLayout;
    verticalLayout->addWidget(scrollArea);
    verticalLayout->addLayout(pageNavigationLayout);
    verticalLayout->addLayout(letterAdjustAndLetters);
    verticalLayout->addLayout(testLayout);


    QHBoxLayout *buttonsLayout = new QHBoxLayout;
    buttonsLayout->addStretch(1);
    buttonsLayout->addWidget(saveToFileButton);
    buttonsLayout->addWidget(confirmButton);
    buttonsLayout->addWidget(closeButton);

    QVBoxLayout *mainLayout = new QVBoxLayout;
    mainLayout->addLayout(verticalLayout);
    //mainLayout->addStretch(1);
    //mainLayout->addSpacing(12);
    mainLayout->addLayout(buttonsLayout);
    setLayout(mainLayout);
    resize(1000, 600);
   
    setWindowTitle(tr("Font Creater"));
    
    displayPage();
}
Exemple #13
0
void Gui::endMacro()
{
    undoStack->endMacro();
    --macroNesting;
    displayPage();
}
    // Function:     waitForCommand
    // Inputs:       NA
    // Outputs:      False if user wants to quit, true otherwise
    // Description:  This function displays the available commands and waits
    //               for the user to input an integer [1,8]. If the value entered
    //               is not an integer or is outside of the defined range, it
    //               displays an error message.
    //
    bool Menu::waitForCommand()
    {
        // The value that the user input command is stored into.
        int whichCommand;
        
        // Display the command options available.
        std::cout << NEW_LINE << TAB << INPUT_NEW_USER << STRING_CREATE_USER;
        std::cout << TAB << INPUT_NEW_MESSAGE << STRING_POST_MESSAGE;
        std::cout << TAB << INPUT_NEW_TWEET << STRING_POST_TWEET;
        std::cout << TAB << INPUT_DISPLAY_WALL << STRING_DISPLAY_WALL;
        std::cout << TAB << INPUT_DISPLAY_HOME << STRING_DISPLAY_HOME;
        std::cout << TAB << INPUT_ADD_FRIEND << STRING_ADD_FRIEND;
        std::cout << TAB << INPUT_SWITCH_USER << STRING_SWITCH_USER;
        std::cout << TAB << INPUT_EXIT << STRING_QUIT;
        std::cout << TAB + TAB + STRING_CHOOSE_OPTION;
        
        // Read an input from the command line as a string.
        std::string inputString;
        std::getline(std::cin,inputString);
        
        // If string is not one char, throw an error.
        if ( inputString.length() > 1 )
        {
            std::cout << NEW_LINE << TAB << TAB << STRING_INVALID_COMMAND;
            return waitForCommand();
        }
        
        // Convert the string to an integer.
        whichCommand = std::atoi(inputString.c_str());

        // Check to see if whichCommand is [1,8], if not display an error
        switch ( whichCommand )
        {
            case INPUT_NEW_USER:
                waitForNewUser();
                break;
                
            case INPUT_NEW_MESSAGE:
                waitForNewMessage();
                break;
                
            case INPUT_NEW_TWEET:
                waitForNewTweet();
                break;
                
            case INPUT_DISPLAY_HOME:
                displayPage(board.toHomeVector(users.getCurrentUser()), true);
                break;
                
            case INPUT_DISPLAY_WALL:
                displayPage(board.toWallVector(users.getCurrentUser()), false);
                break;
                
            case INPUT_ADD_FRIEND:
                waitForNewFriend();
                break;
                
            case INPUT_SWITCH_USER:
                waitForAlternateUser();
                break;
                
            case INPUT_EXIT:
                return false;
                
            default:
                std::cout << NEW_LINE + TAB + TAB + STRING_INVALID_COMMAND;
                return waitForCommand();
                
                
        }
        
        return true;
    }