本文整理汇总了C++中TextView类的典型用法代码示例。如果您正苦于以下问题:C++ TextView类的具体用法?C++ TextView怎么用?C++ TextView使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了TextView类的18个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: getActiveTextView
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);
}
开发者ID:JesperMikkelsen,项目名称:Big-Numbers,代码行数:35,代码来源:MainFrm.cpp
示例2: TextView
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;
}
开发者ID:dantheman213,项目名称:ppsspp,代码行数:33,代码来源:DevScreens.cpp
示例3: dc
void CMainFrame::OnPaint() {
CPaintDC dc(this); // device context for painting
TextView *view = getActiveTextView();
if(view) {
view->refreshBoth();
}
}
开发者ID:JesperMikkelsen,项目名称:Big-Numbers,代码行数:7,代码来源:MainFrm.cpp
示例4: main
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) ;
}
开发者ID:2015cnugithub,项目名称:2151002049LiuSiYu,代码行数:32,代码来源:mvc.cpp
示例5: UtcDaliPushButtonSetLabelText
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() );
}
开发者ID:Tarnyko,项目名称:dal-toolkit,代码行数:25,代码来源:utc-Dali-PushButton.cpp
示例6:
KTextEditor::View *PartController::activeView()
{
TextView* textView = dynamic_cast<TextView*>(Core::self()->uiController()->activeArea()->activeView());
if (textView) {
return textView->textView();
}
return 0;
}
开发者ID:caidongyun,项目名称:kdevplatform,代码行数:8,代码来源:partcontroller.cpp
示例7: MainWindow
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);
}
开发者ID:bencz,项目名称:cpu-simulator,代码行数:57,代码来源:winide.cpp
示例8: openURL
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();
}
开发者ID:zoltanp,项目名称:ktechlab-0.3,代码行数:10,代码来源:docmanager.cpp
示例9: VALIDATE_NOT_NULL
//@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;
}
开发者ID:TheTypoMaster,项目名称:ElastosRDK5_0,代码行数:27,代码来源:DateTimeSuggestionListAdapter.cpp
示例10: WIN32IDE
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);
}
开发者ID:sanyaade-teachings,项目名称:elena-lang,代码行数:40,代码来源:winide.cpp
示例11: newDocument
//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();
}
开发者ID:bencz,项目名称:cpu-simulator,代码行数:34,代码来源:gtkeditframe.cpp
示例12: switch
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();
}
}
开发者ID:xufooo,项目名称:fbreader-e2-test,代码行数:24,代码来源:FBReaderActions.cpp
示例13: init_home_screen
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();
}
开发者ID:stenniswood,项目名称:bk_code,代码行数:31,代码来源:home_screen.cpp
示例14: Point
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);
}
开发者ID:fiskercui,项目名称:testcommon,代码行数:8,代码来源:Adapter.cpp
示例15: Update
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 );
}
开发者ID:peekaye,项目名称:Syllable-sIRC,代码行数:57,代码来源:sIRC32.cpp
示例16: SendMsg
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);
}
开发者ID:peekaye,项目名称:Syllable-sIRC,代码行数:15,代码来源:sIRC32.cpp
示例17: AttachedToWindow
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 );
}
开发者ID:peekaye,项目名称:Syllable-sIRC,代码行数:8,代码来源:sIRC32.cpp
示例18: send_to_viki
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 );
}
开发者ID:stenniswood,项目名称:bk_code,代码行数:11,代码来源:home_screen.cpp
注:本文中的TextView类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论