Пример #1
0
void CMainFrame::OnFileOpen(int id) {
  TextView   *view = getActiveTextView();
  if(view == NULL) {
    showWarning(_T("No active view"));
    return;
  }
  CFileDialog dlg(TRUE);
  dlg.m_ofn.lpstrFilter  = getFileDialogExtension().cstr();
  dlg.m_ofn.lpstrTitle   = _T("Open files");
  dlg.m_ofn.nFilterIndex = getOptions().m_defaultExtensionIndex;
  dlg.m_ofn.Flags |= OFN_ALLOWMULTISELECT | OFN_FILEMUSTEXIST;
  TCHAR fileNames[1024];
  fileNames[0]           = 0;
  dlg.m_ofn.lpstrFile    = fileNames;
  dlg.m_ofn.nMaxFile     = ARRAYSIZE(fileNames);

  if((dlg.DoModal() != IDOK) || (_tcsclen(fileNames) == 0)) {
    return;
  }
  getOptions().m_defaultExtensionIndex = dlg.m_ofn.nFilterIndex;

  TCHAR *files[3];
  getFileNames(files,fileNames);

  CWinDiffDoc *doc = view->getDocument();

  if(_tcsclen(files[1]) == 0) { // only one selected
    doc->setDoc(id, DIFFDOC_FILE, files[0]);
  } else {
    const String f1 = FileNameSplitter::getChildName(files[0],files[1]);
    const String f2 = FileNameSplitter::getChildName(files[0],files[2]);
    doc->setDocs(f1, f2);
  }
  Invalidate(FALSE);
}
Пример #2
0
void LogScreen::UpdateLog() {
    using namespace UI;
    RingbufferLogListener *ring = LogManager::GetInstance()->GetRingbufferListener();
    if (!ring)
        return;
    vert_->Clear();
    for (int i = ring->GetCount() - 1; i >= 0; i--) {
        TextView *v = vert_->Add(new TextView(ring->TextAt(i), FLAG_DYNAMIC_ASCII, false));
        uint32_t color = 0xFFFFFF;
        switch (ring->LevelAt(i)) {
        case LogTypes::LDEBUG:
            color = 0xE0E0E0;
            break;
        case LogTypes::LWARNING:
            color = 0x50FFFF;
            break;
        case LogTypes::LERROR:
            color = 0x5050FF;
            break;
        case LogTypes::LNOTICE:
            color = 0x30FF30;
            break;
        case LogTypes::LINFO:
            color = 0xFFFFFF;
            break;
        case LogTypes::LVERBOSE:
            color = 0xC0C0C0;
            break;
        }
        v->SetTextColor(0xFF000000 | color);
    }
    toBottom_ = true;
}
Пример #3
0
void init_home_screen()
{
	//strcpy(CommandText, "connect to 192.168.2.14, Robot, show me the accuracy of your positioning. Show me a histogram for right leg positions.\
	// Lift your left leg.  Raise both arms.  Go to the bedroom and get my shoes." );	
	strcpy (CommandText, "what time?");
	ClientInputEdit.set_text			( CommandText );
	ClientInputEdit.set_text_size 		( 16.0 			);	
	ClientInputEdit.set_return_key_listener( send_to_viki, &ClientInputEdit );
	
	//printf("init_home_screen() ClientInput text setup\n");
	
	RobotResponse.set_text				( "Not Connected" );				// ConnectionStatus	
	if (ipc_memory_client) {
		//printf("init_home_screen() RobotResponse text %s\n", ipc_memory_client->Sentence );
		RobotResponse.set_text			( ipc_memory_client->Sentence );	// ConnectionStatus		
	}
	RobotResponse.set_text_size 		( 16.0 		 );
	RobotResponse.set_text_color		( 0xCFFF0000 );
	RobotResponse.set_background_color  ( 0xFFFFFf00 );
	
	// This should be hidden until asked for via voice.
	//AvailClients.move_to( 20, 75 );

	// Add to display manager:
	MainDisplay.remove_all_objects(		  );
	MainDisplay.add_object( &ClientInputEdit);
	MainDisplay.add_object( &RobotResponse 	);
	MainDisplay.add_object( &AvailClients 	);
//	MainDisplay.add_object( &adren_board_list );
//	MainDisplay.load_resources();
}
Пример #4
0
void CMainFrame::OnPaint() {
  CPaintDC dc(this); // device context for painting
  TextView *view = getActiveTextView();
  if(view) {
    view->refreshBoth();
  }
}
Пример #5
0
int main()
{
  Sphere sphere(50);
  TextView textView;
  GraphicsView graphicsView;
  GraphicsController graphicsController(&sphere);
  TextController textController(&sphere);
  sphere.addObserver(&textView);
  sphere.addObserver(&graphicsView);
  textView.update(&sphere);
  graphicsView.update(&sphere);
  
  int i=0;
  double r,x,y;
  while(i!=3)
  {
	  cout<<"1.更改textview半径"<<endl;
      cout<<"2.更改Graphicsview半径"<<endl;
	  cout<<"3.退出"<<endl;
	  cin>>i;
		  if(i==1)
		  {
			  cout<<"输入半径"<<endl;
			  cin>>r;
              textController.actionPerformed(r);
		  }
		  if(i==2)
		  {
			  cout<<"输入坐标x,y"<<endl;
			  cin>>x>>y;
              graphicsController.mouseDragged(x,y) ;
		  }
Пример #6
0
static void UtcDaliPushButtonSetLabelText()
{
    ToolkitTestApplication application;
    tet_infoline(" UtcDaliPushButtonSetLabelText");

    const std::string STR( "Hola!" );

    PushButton pushButton = PushButton::New();

    application.SendNotification();
    application.Render();

    TextView textView;

    pushButton.SetLabelText( STR );

    textView = TextView::DownCast( pushButton.GetLabelText() );
    DALI_TEST_CHECK( STR == textView.GetText() );

    TextView text = TextView::New( STR );
    pushButton.SetLabelText( text );

    textView = TextView::DownCast( pushButton.GetLabelText() );
    DALI_TEST_CHECK( STR == textView.GetText() );
}
Пример #7
0
void TextShape2::BoundingBox(Point& bottemLeft, Point& topRight) const
{
    Coord bottem , left , width , height;
    m_pText->GetOrigin(bottem, left);
    m_pText->GetExtent(width, height);
    bottemLeft = Point(bottem , left);
    topRight = Point(bottem+height, left+width);
}
Пример #8
0
KTextEditor::View *PartController::activeView()
{
    TextView* textView = dynamic_cast<TextView*>(Core::self()->uiController()->activeArea()->activeView());
    if (textView) {
        return textView->textView();
    }
    return 0;
}
Пример #9
0
BYTE CMainFrame::getFocusFlags() {
  BYTE result;
  if(m_hasFocus) result |= MAINHASFOCUS;
  TextView *view = getActiveTextView();
  if(view) {
    result |= (view->getId() == 0) ? PANEL0ACTIVE : PANEL1ACTIVE;
  }
  return result;
}
Пример #10
0
void CMainFrame::activateOptions() {
  TextView *view = getActiveTextView();
  if(view == NULL) {
    return;
  }
  view->setOptions(getOptions());
  setWindowSize(this, getOptions().m_windowSize);
  updateCheckedMenuItems();
}
Пример #11
0
MainWindow :: MainWindow(HINSTANCE instance, const wchar_t* caption, _Controller* controller, Model* model)
   : SDIWindow(instance, caption), _windowList(10, IDM_WINDOW_WINDOWS), _recentFiles(10, IDM_FILE_FILES), _recentProjects(10, IDM_FILE_PROJECTS), _contextBrowser(model)
{
   _controller = controller;
   _model = model;
   _tabTTHandle = NULL;

   _controlCount = 14;
   _controls = (_BaseControl**)malloc(_controlCount << 2);

   _controls[0] = NULL;
   _controls[CTRL_MENU] = new Menu(instance, IDR_IDE_ACCELERATORS, ::GetMenu(getHandle()));
   _controls[CTRL_CONTEXTMENU] = new ContextMenu();

   _windowList.assign((Menu*)_controls[CTRL_MENU]);
   _recentFiles.assign((Menu*)_controls[CTRL_MENU]);
   _recentProjects.assign((Menu*)_controls[CTRL_MENU]);

   ContextMenu* contextMenu = (ContextMenu*)_controls[CTRL_CONTEXTMENU];

   contextMenu->create(8, contextMenuInfo);

   _controls[CTRL_STATUSBAR] = new StatusBar(this, 5, StatusBarWidths);
   _controls[CTRL_TOOLBAR] = new ToolBar(this, 16, AppToolBarButtonNumber, AppToolBarButtons);
   _controls[CTRL_EDITFRAME] = new EditFrame(this, true, contextMenu, model);
   _controls[CTRL_TABBAR] = new TabBar(this, _model->tabWithAboveScore);
   _controls[CTRL_OUTPUT] = new Output((Control*)_controls[CTRL_TABBAR], this);
   _controls[CTRL_MESSAGELIST] = new MessageLog((Control*)_controls[CTRL_TABBAR]);
   _controls[CTRL_CALLLIST] = new CallStackLog((Control*)_controls[CTRL_TABBAR]);
   _controls[CTRL_BSPLITTER] = new Splitter(this, (Control*)_controls[CTRL_TABBAR], false, IDM_LAYOUT_CHANGED);
   _controls[CTRL_CONTEXTBOWSER] = new TreeView((Control*)_controls[CTRL_TABBAR], true);
   _controls[CTRL_PROJECTVIEW] = new TreeView(this, false);
   _controls[CTRL_HSPLITTER] = new Splitter(this, (Control*)_controls[CTRL_PROJECTVIEW], true, IDM_LAYOUT_CHANGED);

   ((Control*)_controls[CTRL_TABBAR])->_setHeight(120);
   ((Control*)_controls[CTRL_BSPLITTER])->_setConstraint(60, 100);
   ((Control*)_controls[CTRL_PROJECTVIEW])->_setWidth(200);

   _statusBar = (StatusBar*)_controls[CTRL_STATUSBAR];

   EditFrame* frame = (EditFrame*)_controls[CTRL_EDITFRAME];
   TextView* textView = new TextView(frame, 5, 28, 400, 400);
   frame->populate(textView);
   textView->setReceptor(this);
   _contextBrowser.assign((Control*)_controls[CTRL_CONTEXTBOWSER]);
   
   setLeft(CTRL_HSPLITTER);
   setTop(CTRL_TOOLBAR);
   setClient(CTRL_EDITFRAME);
   setBottom(CTRL_BSPLITTER);

   frame->init(model);

   showControls(CTRL_STATUSBAR, CTRL_EDITFRAME);

   showControls(CTRL_PROJECTVIEW, CTRL_PROJECTVIEW);
}
Пример #12
0
void MainView::Update(void)
{
 			cout << "Updating textOutputView" << endl;	 					
// First we get the infomation taken from the IRC server and put into "buf" is added to the textOutputView
//	We then check the incoming data to see if it contains the PING command from the server.			
			int i;
			string bufstring;
			bufstring = buf;					
			i = bufstring.find("PING");
			cout << "Ping?\n" << endl;
			cout << i << endl;
			cout << bufstring << endl;
			if (i == -1) {
				cout << "No Ping" << endl;
				}
//	If it does we return the message "Pong nick\n", The Ping is sent from the server to check that 
//	we are still receiving messages
//	However due Ping being mentioned in the MOTD from freenode here is a dirty hack to get round this,
//	it only checks if the PING command is not equal to -1 (-1 is returned when Ping isn't mentioned)
//	and less then 80. (80 not 10 as it allows you to test the function by sending a PRIVMSG with Ping
//	embedded.					
			else if (i !=-1) {
				if (i < 80) {
					cout << "Yes Ping" << endl;
					sendmessage = "PONG " + nick + end;		
					messagetosend = 1;
					}
				else {
					cout << "No Ping" << endl;
					}
				}
//	Once the Ping command is done we now need to cut down the message to contain just the nick
//	of the sender and also the message itself.	Now this gets a little stuck with the MOTD from
//	the server so we only turn it on once we have joined a channel. (when erase = 1)
			if (erase ==1){
				string bufstring1;
				string bufstring2;						
				string bufstring3;							
				bufstring1 = buf;
				string find1 = "!";
				string::size_type pos = bufstring1.find (find1,0);
				string find2 = "#";									
				string::size_type pos1 = bufstring1.find (find2,0);
				int pos2, totallength;
				pos2 = pos1 - pos;				
				bufstring2 = bufstring1.erase (pos, pos2);	
				const char* bufchar;					
				bufchar = bufstring2.c_str();				
				textOutputView->Insert(bufchar, true);		
				}
			else {
				textOutputView->Insert(buf, true);	
				}
			if( m_CommThread )
			m_CommThread->PostMessage( MSG_TOLOOPER_START, m_CommThread, m_CommThread ); 											
		
}
Пример #13
0
void DocManager::gotoTextLine( const KURL &url, int line )
{
	TextDocument * doc = dynamic_cast<TextDocument*>( openURL(url) );
	TextView * tv = doc ? doc->textView() : 0;
	
	if ( !tv ) return;
	
	tv->gotoLine(line);
	tv->setFocus();
}
Пример #14
0
void CMainFrame::OnEditPaste() {
  TextView *view = getActiveTextView();
  if(view == NULL) {
    return;
  }
  const String t = getClipboardText();
  CWinDiffDoc *doc = view->getDocument();

  doc->setDoc(view->getId(),DIFFDOC_BUF,t);
  view->refreshBoth();
}
Пример #15
0
void CMainFrame::refreshDoc(bool recomp) {
  TextView *view = getActiveTextView();
  if(view == NULL) {
    return;
  }

  CWinDiffDoc *doc = view->getDocument();
  if(recomp) {
    doc->recompare();
  }
  view->savePositionState();
  view->refreshBoth();
}
Пример #16
0
void CMainFrame::OnOptionsDefineRegex() {
  TextView *view = getActiveTextView();
  if(view == NULL) {
    return;
  }
  RegexFilter param = getOptions().m_regexFilter;
  CRegexDlg dlg(param);
  if(dlg.DoModal() == IDOK) {
    getOptions().m_regexFilter = param;
    if(isMenuItemChecked(this, ID_OPTIONS_IGNOREREGEX)) {
      view->setIgnoreRegex(true);
    }
  }
}
Пример #17
0
void MainView::SendMsg (void)
{
	textfrominput = textInputView->GetBuffer()[0].const_str();
	cout << "Text from input: " << textfrominput << endl;
	messagetosend = 1;		
	sendmessage = priv + channel + " :" + textfrominput + end;	
	Message *msg1 = new Message(MSG_TOLOOPER_START);
	Mail("Commthread", msg1);	
	string printinputmessage = nick + channel + " : " + textfrominput + end;	
	cout << printinputmessage << endl;	
	const char* msgupdate;
	msgupdate = printinputmessage.c_str();	
	textOutputView->Insert(msgupdate, true);
	textInputView->Clear(true);	
}
Пример #18
0
void CMainFrame::OnViewTabSize() {
  TextView *view = getActiveTextView();
  if(view == NULL) {
    return;
  }
  CWinDiffDoc *doc = view->getDocument();

  const int tabSize = doc->m_diff.getTabSize();
  CTabSizeDlg dlg(tabSize);
  if(dlg.DoModal() == IDOK) {
    if(dlg.m_tabSize != doc->m_diff.getTabSize()) {
      view->setTabSize(dlg.m_tabSize, true);
    }
  }
}
Пример #19
0
void CMainFrame::ajourMenuItems() {
  TextView    *view    = getActiveTextView();
  bool         hasView = view != NULL;
  CWinDiffDoc *doc     = getDoc();
  const Diff &diff     = doc->m_diff;

  if(!hasView) {
    enableMenuItem(this, ID_EDIT_COPY                     , false);
    enableMenuItem(this, ID_EDIT_SELECTALL                , false);

    enableToolbarButtonAndMenuItem(ID_EDIT_FIND           , false);
    enableToolbarButtonAndMenuItem(ID_EDIT_FIND_NEXT      , false);
    enableToolbarButtonAndMenuItem(ID_EDIT_FIND_PREV      , false);
    enableToolbarButtonAndMenuItem(ID_EDIT_PREV_DIFF      , false);

    enableMenuItem(this, ID_EDIT_GOTO                     , false);
    enableMenuItem(this, ID_EDIT_REFRESHFILES             , false);
    enableMenuItem(this, ID_VIEW_HIGHLIGHTCOMPAREEQUAL    , false);

    enableToolbarButtonAndMenuItem(ID_EDIT_NEXT_DIFF      , false);
    enableToolbarButtonAndMenuItem(ID_EDIT_SHOWDETAILS    , false);
    showStatusBarPanes(false);
  } else {
    const bool hasText = !diff.getDoc(view->getId()).isEmpty();

    enableMenuItem(this, ID_EDIT_COPY                     , !view->getSelectedRange().isEmpty());
    enableMenuItem(this, ID_EDIT_SELECTALL                , hasText);

    enableToolbarButtonAndMenuItem(ID_EDIT_FIND           , hasText);
    enableToolbarButtonAndMenuItem(ID_EDIT_FIND_NEXT      , hasText);
    enableToolbarButtonAndMenuItem(ID_EDIT_FIND_NEXT      , hasText);
    enableToolbarButtonAndMenuItem(ID_EDIT_FIND_PREV      , hasText);
    enableToolbarButtonAndMenuItem(ID_EDIT_FIND_PREV      , hasText);

    enableMenuItem(this, ID_EDIT_GOTO                     , hasText);
    enableMenuItem(this, ID_EDIT_REFRESHFILES             , diff.hasFileDoc());
    enableMenuItem(this, ID_VIEW_HIGHLIGHTCOMPAREEQUAL    , doc->m_filter.hasLineFilter());
    if(!doc->m_filter.hasLineFilter()) {
      checkMenuItem(this, ID_VIEW_HIGHLIGHTCOMPAREEQUAL, false);
    }
    enableToolbarButtonAndMenuItem( ID_EDIT_SHOWDETAILS   , !diff.isEmpty() && !diff.getDiffLines()[view->getCurrentLine()].linesAreEqual());
    enableToolbarButtonAndMenuItem( ID_EDIT_PREV_DIFF     , !diff.isEmpty() && (view->getCurrentLine() > diff.getFirstDiffLine()));
    enableToolbarButtonAndMenuItem( ID_EDIT_NEXT_DIFF     , !diff.isEmpty() && (view->getCurrentLine() < diff.getLastDiffLine()));

    showStatusBarPanes(!diff.isEmpty());
  }
  updateNameFontSizeMenuItems(getOptions().m_nameFontSizePct);
}
Пример #20
0
void CMainFrame::OnOptionsDefineColumns() {
  TextView *view = getActiveTextView();
  if(view == NULL) {
    return;
  }

  FileFormat param = getOptions().m_fileFormat;

  CDefineFileFormatDlg dlg(param,view->getCurrentOrigString());
  if(dlg.DoModal() == IDOK) {
    getOptions().m_fileFormat = param;
    if(isMenuItemChecked(this, ID_OPTIONS_IGNORECOLUMNS)) {
      view->setIgnoreColumns(true);
    }
  }
}
Пример #21
0
void CMainFrame::OnOptionsIgnoreRegex() {
  TextView *view = getActiveTextView();
  if(view == NULL) {
    return;
  }
  if(!isMenuItemChecked(this, ID_OPTIONS_IGNOREREGEX)) {
    const Options &options = getOptions();
    if(options.m_regexFilter.isEmpty()) {
      OnOptionsDefineRegex();
    }
    if(options.m_regexFilter.isEmpty()) {
      return;
    }
  }
  view->setIgnoreRegex(toggleMenuItem(this, ID_OPTIONS_IGNOREREGEX));
}
Пример #22
0
void MainView::AttachedToWindow()
{
//ensure messages are sent to the view and not the window
	LayoutView::AttachedToWindow();
	textInputView->SetTarget(this);
	m_pcStart->SetTarget(this);
	mainMenuBar->SetTargetForItems( this ); 	
}
Пример #23
0
void CMainFrame::OnOptionsIgnoreColumns() {
  TextView *view = getActiveTextView();
  if(view == NULL) {
    return;
  }

  if(!isMenuItemChecked(this, ID_OPTIONS_IGNORECOLUMNS)) {
    const Options &options = getOptions();
    if(options.m_fileFormat.isEmpty()) {
      OnOptionsDefineColumns();
    }
    if(options.m_fileFormat.isEmpty()) {
      return;
    }
  }
  view->setIgnoreColumns(toggleMenuItem(this,ID_OPTIONS_IGNORECOLUMNS));
}
Пример #24
0
void send_to_viki( void* mEditBoxPtr )
{
	printf("send_to_viki() callback reached!\n");
	
	EditBox* eb = 	(EditBox*)mEditBoxPtr;
	char* str = eb->get_text();
	if (is_client_ipc_memory_available()==false)
		RobotResponse.set_text("Viki is down.");
		
	cli_ipc_write_sentence( str );
}
//@Override
ECode DateTimeSuggestionListAdapter::GetView(
    /* [in] */ Int32 position,
    /* [in] */ IView* convertView,
    /* [in] */ IViewGroup* parent,
    /* [out] */ IView** outView)
{
    VALIDATE_NOT_NULL(outView);

    View layout = convertView;
    if (convertView == null) {
        LayoutInflater inflater = LayoutInflater.from(mContext);
        layout = inflater.inflate(R.layout.date_time_suggestion, parent, false);
    }
    TextView labelView = (TextView) layout.findViewById(R.id.date_time_suggestion_value);
    TextView sublabelView = (TextView) layout.findViewById(R.id.date_time_suggestion_label);

    if (position == getCount() - 1) {
        labelView.setText(mContext.getText(R.string.date_picker_dialog_other_button_label));
        sublabelView.setText("");
    } else {
        labelView.setText(getItem(position).localizedValue());
        sublabelView.setText(getItem(position).label());
    }

    return layout;
}
Пример #26
0
WIN32IDE :: WIN32IDE(HINSTANCE instance, AppDebugController* debugController)
   : IDE(debugController), controls(NULL, _ELENA_::freeobj)
{
   this->instance = instance;

   // create main window & menu
   _appWindow = new MainWindow(instance, _T("IDE"), this);
   _appMenu = new Menu(instance, IDR_IDE_ACCELERATORS, ::GetMenu(_appWindow->getHandle()));
   contextMenu.create(8, contextMenuInfo);

   _appToolBar = new ToolBar(_appWindow, 16, AppToolBarButtonNumber, AppToolBarButtons);
   _statusBar = new StatusBar(_appWindow, 5, StatusBarWidths);
   _outputBar = createOutputBar();
   _contextBrowser = createContextBrowser();

   _mainFrame = new EditFrame(_appWindow, true, &contextMenu);
   TextView* textView = new TextView(_mainFrame, 5, 28, 400, 400);
   _mainFrame->populate(textView);
   textView->setReceptor(_appWindow);

   _mainFrame->show();
   _appToolBar->show();
   _statusBar->show();

   _appWindow->_getLayoutManager()->setAsTop(_appToolBar);
   _appWindow->_setStatusBar(_statusBar);
   _appWindow->_getLayoutManager()->setAsClient(_mainFrame);

   controls.add(_mainFrame);
   controls.add(textView);
   controls.add(_statusBar);
   controls.add(_appToolBar);
   controls.add(_appMenu);
   controls.add(_appWindow);

   // initialize recent files / projects / windows manager
   _recentFiles.assign(_appMenu);
   _recentProjects.assign(_appMenu);
   _windowList.assign(_appMenu);
}
Пример #27
0
void CMainFrame::onFileMruFile(int index) {
  TextView *view = getActiveTextView();
  if(view == NULL) return;
  try {
    const String fname = theApp.getRecentFile(index);

    if(ACCESS(fname, 4) < 0) {
      const int errorCode = errno;
      showWarning(getErrnoText());
      if(errorCode == ENOENT) {
        theApp.removeFromRecentFiles(index);
      }
      return;
    }
    CWinDiffDoc *doc = view->getDocument();
    doc->setDoc(view->getId(),DIFFDOC_FILE, fname);
    Invalidate(FALSE);
    //view->refreshBoth();
  } catch(Exception e) {
    showException(e);
  }
}
Пример #28
0
//Document* EditFrame :: getDocument(int index)
//{
////   if (index != -1) {
////      TextView* textView = (TextView*)_getTabControl(index);
////
////      return textView ? textView->getDocument() : NULL;
////   }
////   else return _currentDoc;
//
//   return NULL; // !!temporal
//}
//
int EditFrame :: newDocument(const char* name, Document* document)
{
   TextView* textView = new _GUI_::TextView();

   textView->setStyles(STYLE_MAX + 1, _schemes[_scheme], 15, 20);
   textView->applySettings(_model->tabSize, _model->tabCharUsing, _model->lineNumberVisible, _model->highlightSyntax);

   textView->setDocument(document);

   textView->show(); // !! temporal?

//   g_signal_connect(textView->getWidgetHandle(), "editor-changed",
//         G_CALLBACK(editor_changed), _owner);
//
//   g_signal_connect(textView->getWidgetHandle(), "ctrl-tab-pressed",
//         G_CALLBACK(ctrl_tab_pressed), _owner);

   addTab(name, textView);

   show();
   setFocus();
}
Пример #29
0
void FBReader::ScrollingAction::run() {
	int delay = myFBReader.myLastScrollingTime.millisecondsTo(ZLTime());
	TextView *textView = (TextView*)myFBReader.currentView();
	if ((textView != 0) && ((delay < 0) || (delay >= myOptions.DelayOption.value()))) {
		TextView::ScrollingMode oType = (TextView::ScrollingMode)myOptions.ModeOption.value();
		unsigned int oValue = 0;
		switch (oType) {
			case TextView::KEEP_LINES:
				oValue = myOptions.LinesToKeepOption.value();
				break;
			case TextView::SCROLL_LINES:
				oValue = myOptions.LinesToScrollOption.value();
				break;
			case TextView::SCROLL_PERCENTAGE:
				oValue = myOptions.PercentToScrollOption.value();
				break;
			default:
				break;
		}
		textView->scrollPage(myForward, oType, oValue);
		myFBReader.refreshWindow();
		myFBReader.myLastScrollingTime = ZLTime();
	}
}
Пример #30
0
BOOL CMainFrame::doPreTranslateMessage(MSG *pMsg) {
  const BOOL ret  = __super::PreTranslateMessage(pMsg);
  TextView  *view = getActiveTextView();
  if(view == NULL) return ret;

  const TextPosition pos = view->getCurrentPos();

  m_wndStatusBar.SetPaneText(4, format(_T("Ln %d, Col %d"), pos.m_line+1, pos.m_column+1).cstr());

  const TCHAR *msgStr = NULL;
  switch(pMsg->message) {
  case WM_PAINT      : msgStr = _T("WM_PAINT")      ; break;
  case WM_NCMOUSEMOVE: msgStr = _T("WM_NCMOUSEMOVE"); break;
  case WM_SIZING     : msgStr = _T("WM_SIZING")     ; break;
  case WM_SIZE       : msgStr = _T("WM_SIZE")       ; break;
  case 118           : msgStr = _T("msg(118)")      ; break;
  }
  if(m_statusPanesVisible && msgStr) {
    CRect rect;
    m_wndStatusBar.GetItemRect(1,&rect);
    CStatusBarCtrl &statusBar =  m_wndStatusBar.GetStatusBarCtrl();
    CClientDC dc(&statusBar);

    m_wndStatusBar.SetPaneText(1,EMPTYSTRING);
    textOutTransparentBackground(dc, rect.TopLeft()+CSize(2,1), _T("Deleted lines"), *statusBar.GetFont(), BLUE);

    m_wndStatusBar.GetItemRect(2,&rect);
    m_wndStatusBar.SetPaneText(2,EMPTYSTRING);
    textOutTransparentBackground(dc, rect.TopLeft()+CSize(2,1), _T("Changed lines"), *statusBar.GetFont(), RED);

    m_wndStatusBar.GetItemRect(3,&rect);
    m_wndStatusBar.SetPaneText(3,EMPTYSTRING);
    textOutTransparentBackground(dc, rect.TopLeft()+CSize(2,1), _T("Inserted lines"), *statusBar.GetFont(), GREEN);
  }
  return ret;
}