Example #1
0
void HeaderCtrl::LeftDown(Point p, dword keyflags) {
#ifdef _DEBUG
	if(keyflags & K_CTRL) {
		String text;
		for(int i = 0; i < col.GetCount(); i++)
			text += Format(i ? " %d" : "%d", GetTabWidth(i));
		WriteClipboardText(".ColumnWidths(\"" + text + "\");");
		BeepExclamation();
	}
#endif
	split = GetSplit(p.x);
	if(IsNull(split)) return;
	SetCapture();
	if(split >= 0) {
		colRect = GetTabRect(split);
		return;
	}
	li = pushi = -1 - split;
	col[pushi].WhenLeftClick();
#ifdef _DEBUG
	if((keyflags & K_ALT) && pushi >= 0)
		WriteClipboardText(AsString(GetTabWidth(pushi)));
#endif
	if(pushi >= 0) {
		if(!col[pushi].WhenAction) {
			pushi = -1;
			return;
		}
		colRect = GetTabRect(pushi);
		push = true;
	}
	Refresh();
}
Example #2
0
int PromptAbortRetryIgnore(const char *qtf) {
	BeepExclamation();
	return Prompt(callback(LaunchWebBrowser),
	              Ctrl::GetAppName(), CtrlImg::exclamation(), qtf, false,
	              t_("&Abort"), t_("&Retry"), t_("&Ignore"), 0,
	              AbortButtonImage(), RetryButtonImage(), Null);
}
Example #3
0
int PromptRetryCancel(const char *qtf) {
	BeepExclamation();
	return Prompt(callback(LaunchWebBrowser),
	              Ctrl::GetAppName(), CtrlImg::exclamation(), qtf, true,
	              t_("&Retry"), t_("Cancel"), NULL, 0,
	              RetryButtonImage(), Null, Null);
}
Example #4
0
void Puzzle::LeftDown(Point p, dword)
{
    if(Move(p.x / 32, p.y / 32)) {
        moves++;
        Status();
        int n = size.cx * size.cy - 1;
        for(int i = 0; i < n; i++)
            if(box[i] != i + 1)
                return;
        String dim;
        int& sm = score.GetAdd(String().Cat() << size.cx << "x" << size.cy);
        if(moves < sm) {
            sm = moves;
            PromptOK(t_("You win with the new best score!"));
        }
        else
            PromptOK(t_("You win!"));
        Generate();
    }
    else
        BeepExclamation();
}
Example #5
0
void DlgCalc::Run(CalcContext& context)
{
	calc_context = &context;
	ReadConfigSelf();
	CalcContext::Nesting level(context);
	while(TopWindow::Run() == IDOK) {
		try {
			WaitCursor wait;
			CalcNodePtr node = CalcParser().Scan((String)~exp);
			result_val = node -> Calc(context);
			result <<= context.FormatNull(result_val);
			exp.AddHistory();
		}
		catch(Exc e) {
			result <<= e;
			BeepExclamation();
		}
		exp.SetFocus();
		exp.SetSelection();
	}
	WriteConfigSelf();
	calc_context = NULL;
}
Example #6
0
void ShowExc(const Exc& exc) {
	BeepExclamation();
	Prompt(Ctrl::GetAppName(), CtrlImg::exclamation(), DeQtf(exc), t_("OK"));
}
Example #7
0
void Exclamation(const char *qtf) {
	BeepExclamation();
	Prompt(Ctrl::GetAppName(), CtrlImg::exclamation(), qtf, t_("OK"));
}