Ejemplo n.º 1
0
String SelectPackageDlg::Run(String startwith)
{
	finished = canceled = false;
	if(!IsSplashOpen())
		Open();
	if(selectvars)
		SyncBase(GetVarsName());
	else
		OnBase();
	String bkvar = GetVarsName();
	if(finished)
		return GetCurrentName();
	if(canceled)
		return Null;
	alist.FindSetCursor(startwith);
	clist.FindSetCursor(startwith);
	ActiveFocus(alist.IsShown() ? (Ctrl&)alist : (Ctrl&)clist);
	switch(TopWindow::Run()) {
	case IDOK:  return GetCurrentName();
	case IDYES: return selected;
	default:
		LoadVars(bkvar);
		SyncBase(GetVarsName());
		return Null;
	}
}
Ejemplo n.º 2
0
int ReportWindow::Perform(Report& report, int zoom, const char *caption)
{
	this->report = &report;
//	if(report.dortf)
//		WriteClipboard(GetClipboardFormatCode("Rich text format"), report.rtf.Get());
	pg.Set(report);
	Size sz;
	Rect area = Ctrl::GetWorkArea();
	sz = area.Size() * 4 * abs(zoom) / 500;
	SetRect(sz);

	ActiveFocus(pg);
	Title(caption);
	Open();
	for(;;) {
		ShowPage();
		int c = Run();
		switch(c) {
		case IDCANCEL:
			return false;
		case 999995:
			return Print(report, pg.GetFirst(), caption);
		}
		if(c > 0)
			return c;
	}
}
Ejemplo n.º 3
0
void VegaTab1::MaskDefaultValue() // body of the callback
{
	editName <<= Null;
	editName.SetFilter(FilterCommaSpace);
	editCountry <<= "---";
	editBirth <<= "00.00.00";
	//tsex <<= 1;
	//editTitle <<= "GM";
	editIDFIDE <<= editRatFIDE <<= editIDNat <<= editRatNat <<= 0;
	kcoeff <<= 30;
	ActiveFocus(editName);
}
Ejemplo n.º 4
0
SelectPackageDlg::SelectPackageDlg(const char *title, bool selectvars_, bool main)
: selectvars(selectvars_)
{
	CtrlLayoutOKCancel(*this, title);
	Sizeable().Zoomable();
	Icon(IdeImg::MainPackage(), IdeImg::PackageLarge());
	base.AutoHideSb();
	base.NoGrid();
	base.AddColumn("Assembly");
	base.WhenCursor = THISBACK(OnBase);
	base.WhenBar = THISBACK(ToolBase);
	base.WhenLeftDouble = THISBACK(OnBaseEdit);
	ok.WhenAction = clist.WhenLeftDouble = alist.WhenLeftDouble = THISBACK(OnOK);
	cancel.WhenAction = WhenClose = THISBACK(OnCancel);
	clist.Columns(4);
	clist.WhenEnterItem = clist.WhenKillCursor = THISBACK(ListCursor);
	alist.AddColumn("Package").Add(3);
	alist.AddColumn("Nest");
	alist.AddColumn("Description");
	alist.AddIndex();
	alist.ColumnWidths("108 79 317");
	alist.WhenCursor = THISBACK(ListCursor);
	alist.EvenRowColor();
	alist.SetLineCy(max(Zy(16), Draw::GetStdFontCy()));
	list.Add(clist.SizePos());
	list.Add(alist.SizePos());
	splitter.Horz(base, list);
	splitter.SetPos(2000);
	splitter.Zoom(selectvars ? -1 : 1);
	newu <<= THISBACK(OnNew);
	filter <<= THISBACK(OnFilter);
	filter.Add(MAIN|FIRST, "Main packages of first nest");
	filter.Add(MAIN, "All main packages");
	filter.Add(FIRST, "All packages of first nest");
	filter.Add(0, "All packages");
	filter <<= main ? MAIN|FIRST : 0;
	progress.Hide();
	brief <<= THISBACK(SyncBrief);
	search.NullText("Search (Ctrl+K)", StdFont().Italic(), SColorDisabled());
	search <<= THISBACK(SyncList);
	search.SetFilter(CharFilterDefaultToUpperAscii);
	SyncBrief();
	description.NullText("Package description (Alt+Enter)", StdFont().Italic(), SColorDisabled());
	description <<= THISBACK(ChangeDescription);
	ActiveFocus(brief ? (Ctrl&)clist : (Ctrl&)alist);
	clist.BackPaintHint();
	alist.BackPaintHint();
	base.BackPaintHint();
	loadi = 0;
	loading = false;
	clist.WhenBar = alist.WhenBar = THISBACK(PackageMenu);
}
Ejemplo n.º 5
0
void FindInFilesDlg::Setup(bool replacing)
{
	Title(replacing ? "Find and replace in files" : "Find in files");
	replace_lbl.Show(replacing);
	style.Show(replacing);
	replace_lbl2.Show(replacing);
	replace.Show(replacing);
	Size sz = GetLayoutSize();
	if(!replacing)
		sz.cy -= replace.GetRect().bottom - folder.GetRect().bottom;
	Rect r = GetRect();
	r.SetSize(sz);
	SetRect(r);
	ActiveFocus(find);
}
Ejemplo n.º 6
0
void VegaTab1::AddPlayer() // body of the callback
{
	if ( IsNull(~editName) ) {
		PromptOK("The Name field cannot be empty!");
		return;
	}
	if ( IsNull(~editCountry) ) editCountry <<= "---";
	if ( IsNull(~editBirth)  ) editBirth <<= "00.00.00";
	if ( IsNull(~editIDFIDE) ) editIDFIDE <<= 0;

	arr.Add(1, ~editName, ~editCountry, ~editBirth,  ~tsex?"m":"f", ~editTitle,
	        ~editIDFIDE, ~editRatFIDE, ~editIDNat, ~editRatNat, ~kcoeff, true); // true==1, false==0
	arr.GoEnd();
	ActiveFocus(editName);
	MaskDefaultValue();
}
Ejemplo n.º 7
0
void Ide::SwapBottom()
{
	if(editor.Esc())
		return;
	if(editor.IsFindOpen())
		editor.FindClose();
	else
	if(!designer && !editor.HasFocusDeep())
		ActiveFocus(editor);
	else
	if(IsBottomShown())
		HideBottom();
	else {
		if(btabs.GetCursor() <= 0)
			btabs.SetCursor(1);
		SyncBottom();
	}
}
Ejemplo n.º 8
0
void TemplateDlg::Load(const Vector<String>& p, bool main)
{
	pt.Clear();
	for(int i = 0; i < p.GetCount(); i++) {
		LoadNest(p[i], main);
		nest.Add(p[i]);
	}
	LoadNest(GetLocalDir(), main);
	LoadNest(GetFileFolder(ConfigFile("x")), main, false);
	Sort(pt, FieldRelation(&PackageTemplate::name, StdLess<String>()));
	templist.Clear();
	templist.Add("<empty>");
	for(int i = 0; i < pt.GetCount(); i++)
		templist.Add(pt[i].name);
	if(nest.GetCount())
		nest.SetIndex(0);
	templist.GoBegin();
	ActiveFocus(package);
}
Ejemplo n.º 9
0
void Ide::SyncBottom()
{
	int q = btabs.GetCursor();
	if(q == BCLOSE) {
		HideBottom();
		return;
	}
	if(editor_bottom.GetZoom() >= 0)
		editor_bottom.NoZoom();
	console.Show(q == BCONSOLE);
	console2.Show(q == BCONSOLE2);
	calc.Show(q == BCALC);
	if(bottomctrl)
		bottomctrl->Show(q == BDEBUG);
	calc.LoadHlStyles(editor.StoreHlStyles());
	calc.SetFont(editorfont);
	SetBar();
	if(q == BCALC)
		ActiveFocus(calc);
}
Ejemplo n.º 10
0
void VegaTab1::ModifyPlayer() // body of the callback
{	int int_row;
	int_row=arr.GetCursor();
	if (int_row < 0) return; // prevent the crash of the application when int_row = -1)
	if ( IsNull(~editName) ) {
		Exclamation("The Name field cannot be empty!");
		return;
	}
	arr.Set( int_row, 1, ~editName);
	arr.Set( int_row, 2, ~editCountry);
	arr.Set( int_row, 3, ~editBirth);
	arr.Set( int_row, 4, ~tsex? "m" : "f" );
	arr.Set( int_row, 5, ~editTitle);
	arr.Set( int_row, 6, ~editIDFIDE);
	arr.Set( int_row, 7, ~editRatFIDE);
	arr.Set( int_row, 8, ~editIDNat);
	arr.Set( int_row, 9, ~editRatNat);
	arr.Set( int_row, 10, ~kcoeff);

	ActiveFocus(editName);
	MaskDefaultValue();
}
Ejemplo n.º 11
0
	ParaFormatDlg() {
		CtrlLayoutOKCancel(*this, t_("Paragraph format"));
		ActiveFocus(para.before);
	}