uppsrc.diff

The diff file to apply for uppsrc directory - Sender Ghost, 10/30/2011 06:32 AM

Download (4.48 KB)

View differences:

uppsrc/ide/EditorTabBar.cpp 2011-10-29 00:18:12 +0600
69 69

  
70 70
void Ide::TabFile()
71 71
{
72
	if(!isTabsAction)
73
		return;
72 74
	int q = tabs.GetCursor();
73 75
	if(q >= 0)
74 76
		EditFile(tabs.GetFile(q));
uppsrc/ide/ide.h 2011-10-30 10:52:40 +0600
461 461
	virtual   void   FileSelected();
462 462
	virtual   void   Serialize(Stream& s);
463 463
	virtual   void   FileRename(const String& nm);
464
	virtual   void   FileCloseBefore();
465
	virtual   void   FileCloseAfter(int cur, int sb);
464 466
	virtual   void   DragAndDrop(Point p, PasteClip& d);
465 467

  
466 468
	virtual   void      PutConsole(const char *s);
......
539 541
	One<IdeDesigner> designer;
540 542
	AssistEditor     editor;
541 543
	CodeEditor       editor2;
544
	bool             isTabsAction;
542 545
	EditorTabBar     tabs;
543 546
	EscValue         macro_api;
544 547
#ifdef PLATFORM_POSIX
uppsrc/ide/idefile.cpp 2011-10-30 11:21:35 +0600
396 396
	tabs.RenameFile(editfile, nm);
397 397
}
398 398

  
399
void Ide::FileCloseBefore()
400
{
401
	int c = tabs.GetCursor();
402
	if(c >= 0) {
403
		isTabsAction = false;
404
		tabs.CloseForce(c);
405
	}
406
}
407

  
408
void Ide::FileCloseAfter(int cur, int sb)
409
{
410
	isTabsAction = true;
411
	if(filelist.GetCount())
412
		WorkspaceWork::FileCloseAfter(cur, sb);
413
	else if(tabs.GetCount() == 0) {
414
		tabs.Refresh();
415
		FlushFile();
416
	}
417
	else
418
		TabFile();
419
}
420

  
399 421
void Ide::EditFile0(const String& path, byte charset, bool astext, const String& headername) {
400 422
	editor.CheckEdited(false);
401 423
	editor.CloseAssist();
uppsrc/ide/idewin.cpp 2011-10-28 20:47:54 +0600
504 504

  
505 505
	editor.topsbbutton.ScrollStyle().NoWantFocus().Show();
506 506
	editor.topsbbutton1.ScrollStyle().NoWantFocus().Show();
507
	isTabsAction = true;
507 508
	tabs <<= THISBACK(TabFile);
508 509
//	tabs.WhenCloseRest = THISBACK1(CloseRest, &tabs);
509 510
	editor2.SetFrame(NullFrame());
uppsrc/ide/UppDlg.h 2011-10-30 11:19:08 +0600
173 173
	virtual void   SyncWorkspace()                    {}
174 174
	virtual void   FileSelected()                     {}
175 175
	virtual void   FileRename(const String& nm)       {}
176
	virtual void   FileCloseBefore()                  {}
177
	virtual void   FileCloseAfter(int cur, int sb)    { filelist.SetSbPos(sb); filelist.SetCursor(cur); }
176 178
	virtual void   SyncSvnDir(const String& working)  {}
177 179

  
178 180
	void   ScanWorkspace();
uppsrc/ide/UppWspc.cpp 2011-10-30 10:49:13 +0600
586 586
			if(px >= 0 && (c = closed.Find(Sepfo(GetActivePackage(), actual.file[px]))) >= 0)
587 587
				closed.Unlink(c);
588 588
		}
589
		FileCloseBefore();
589 590
		actual.file.Remove(fx);
590 591
	}
591 592
	if(separator || IsAux())
592 593
		SaveLoadPackageNS();
593 594
	else
594 595
		SaveLoadPackage();
595
	filelist.SetSbPos(s);
596
	filelist.SetCursor(i);
596
	FileCloseAfter(i, s);
597 597
}
598 598

  
599 599
void WorkspaceWork::DelFile()
uppsrc/TabBar/TabBar.cpp 2011-10-29 00:20:05 +0600
2298 2298
	Repos();
2299 2299
}
2300 2300

  
2301
void TabBar::Close(int n)
2301
void TabBar::CloseForce(int n)
2302 2302
{
2303
	if(tabs.GetCount() <= mintabcount)
2304
		return;
2305

  
2306 2303
	if(n == active)
2307 2304
	{
2308 2305
		int c = FindId(tabs[n].id);
......
2332 2329
	}
2333 2330
}
2334 2331

  
2332
void TabBar::Close(int n)
2333
{
2334
	if(tabs.GetCount() <= mintabcount)
2335
		return;
2336

  
2337
	CloseForce(n);
2338
}
2339

  
2335 2340
void TabBar::CloseKey(const Value &key)
2336 2341
{
2337 2342
	int tabix = FindKey(key);
uppsrc/TabBar/TabBar.h 2011-10-30 08:47:26 +0600
394 394
	TabBar& AddKey(const Value& key, const Value& value, Image icon = Null, String group = Null, bool make_active = false);
395 395
	TabBar& InsertKey(int ix, const Value& key, const Value& value, Image icon = Null, String group = Null, bool make_active = false);
396 396
	
397
	void 	CloseForce(int n);
397 398
	void 	Close(int n);
398 399
	void 	CloseKey(const Value& key);
399 400
	void 	Clear();