ide: Fixed issue with layout designer focus for Label on creation #1254

git-svn-id: svn://ultimatepp.org/upp/trunk@8902 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2015-09-06 12:30:55 +00:00
parent 00702e0270
commit cc62b9103a
7 changed files with 13 additions and 24 deletions

View file

@ -142,8 +142,8 @@ void Ctrl::DoDeactivate(Ptr<Ctrl> pfocusCtrl, Ptr<Ctrl> nfocusCtrl)
if(pfocusCtrl) {
Ptr<Ctrl> ptop = pfocusCtrl->GetTopCtrl();
Ctrl *ntop = nfocusCtrl ? nfocusCtrl->GetTopCtrl() : NULL;
LLOG("DoDeactivate " << UPP::Name(ptop) << " in favor of " << UPP::Name(ntop));
if(ntop != ptop && !ptop->destroying) {
LLOG("DoDeactivate " << UPP::Name(ptop) << " in favor of " << UPP::Name(ntop));
ptop->DeactivateBy(ntop);
ptop->Deactivate();
if(ptop)
@ -186,6 +186,7 @@ void Ctrl::DoSetFocus(Ptr<Ctrl> pfocusCtrl, Ptr<Ctrl> nfocusCtrl, bool activate)
if(focusCtrl == nfocusCtrl && nfocusCtrl && nfocusCtrl->parent &&
!nfocusCtrl->parent->destroying)
nfocusCtrl->parent->ChildGotFocus();
SyncCaret();
}
@ -260,7 +261,6 @@ bool Ctrl::SetFocus0(bool activate)
return true;
}
bool Ctrl::SetFocus()
{
GuiLock __;

View file

@ -176,6 +176,8 @@ void Ctrl::SetCaret(int x, int y, int cx, int cy)
void Ctrl::SyncCaret() {
GuiLock __;
DLOG("SyncCaret");
DDUMP(Name(FocusCtrl()));
if(focusCtrl != caretCtrl) {
LLOG("SyncCaret DO " << Upp::Name(caretCtrl) << " -> " << Upp::Name(focusCtrl));
RefreshCaret();
@ -288,7 +290,7 @@ Rect Ctrl::GetVirtualScreenArea()
if(r.right == 0) {
gint x, y, width, height;
gdk_window_get_geometry(gdk_screen_get_root_window(gdk_screen_get_default()),
&x, &y, &width, &height, NULL);
&x, &y, &width, &height, NULL);
r = RectC(x, y, width, height);
}
return r;

View file

@ -917,7 +917,7 @@ void Ctrl::PaintCaret(SystemDraw& w)
void Ctrl::SetCaret(int x, int y, int cx, int cy)
{
GuiLock __;
LLOG("SetCaret " << Name());
LLOG("SetCaret " << Name() << " " << RectC(x, y, cx, cy));
if(this == caretCtrl)
RefreshCaret();
caretx = x;
@ -933,6 +933,7 @@ void Ctrl::SetCaret(int x, int y, int cx, int cy)
void Ctrl::SyncCaret() {
GuiLock __;
LLOG("SyncCaret");
if(focusCtrl != caretCtrl) {
LLOG("SyncCaret DO " << Upp::Name(caretCtrl) << " -> " << Upp::Name(focusCtrl));
RefreshCaret();

View file

@ -166,6 +166,7 @@ void DocEdit::SetSb()
cx = max(Draw::GetStdFontCy(), sz.cx - 2);
sb.SetPage(GetSize().cy);
sb.SetTotal(GetY(para.GetCount()) + 2);
PlaceCaret(false);
}
void DocEdit::Layout()
@ -504,6 +505,7 @@ DocEdit::DocEdit()
sb.WhenScroll = THISBACK(Scroll);
InsertLines(0, 1);
eofline = true;
PlaceCaret(false);
}
DocEdit::~DocEdit() {}

View file

@ -251,15 +251,11 @@ void ExtExclude(CParser& p, Index<String>& x)
Vector<int> remove;
for(int i = 0; i < x.GetCount(); i++)
for(int j = 0; j < e.GetCount(); j++) {
DDUMP(e[j]);
DDUMP(x[i]);
DDUMP(PatternMatch(e[j], x[i]));
if(PatternMatch(e[j], x[i])) {
remove.Add(i);
break;
}
}
DDUMP(remove);
x.Remove(remove);
}
@ -274,16 +270,12 @@ Vector<String> CppBuilder::CustomStep(const String& pf, const String& package_,
Vector<String> dirs;
sGatherAllExt(files, dirs, GetFileFolder(path), "");
DDUMPC(dirs);
Index<String> pkg_files;
Package pkg;
pkg.Load(PackagePath(package));
for(int i = 0; i < pkg.GetCount(); i++)
pkg_files.Add(pkg[i]);
DDUMPC(pkg_files);
Index<String> out;
Index<String> include_path;
String f = LoadFile(path);
@ -337,13 +329,9 @@ Vector<String> CppBuilder::CustomStep(const String& pf, const String& package_,
return Vector<String>();
}
DDUMP(include_path);
DDUMP(GetFileFolder(path));
for(int i = 0; i < include_path.GetCount(); i++)
include.Add(NormalizePath(include_path[i], GetFileFolder(path)));
DDUMPC(include);
Vector<String> o;
for(int i = 0; i < out.GetCount(); i++)
o.Add(SourcePath(package, out[i]));

View file

@ -289,8 +289,6 @@ bool MscBuilder::BuildPackage(const String& package, Vector<String>& linkfile, V
cc = cc_speed;
}
DDUMPC(sfile);
int recompile = 0;
Blitz b;
if(blitz) {

View file

@ -7,6 +7,7 @@ using namespace LayoutKeys;
#include <Draw/iml_source.h>
#define LTIMING(x) // TIMING(x)
#define LLOG(x)
#define MARGIN 8
@ -321,7 +322,7 @@ Image LayDes::CursorImage(Point p, dword keyflags)
if(HasCapture())
hi = draghandle;
else
hi = FindHandle(Normalize(p));
hi = FindHandle(Normalize(p));
Image (*id[11])() = {
Image::SizeHorz, Image::SizeVert, Image::SizeBottomRight,
Image::SizeTopLeft, Image::SizeVert, Image::SizeTopRight,
@ -719,7 +720,6 @@ void LayDes::CreateCtrl(const String& _type)
{
if(IsNull(currentlayout))
return;
LOG("CreateCtrl");
LayoutData& l = CurrentLayout();
int c = l.item.GetCount();
if(cursor.GetCount())
@ -747,13 +747,12 @@ void LayDes::CreateCtrl(const String& _type)
type.SetFocus();
else {
int q = m.FindProperty("SetLabel");
if(q >= 0)
m.property[q].SetFocus();
if(q >= 0 && findarg(_type, "Label", "LabelBox") >= 0)
m.property[q].PlaceFocus(0, 0);
else
variable.SetFocus();
}
}
LOG("Create " << ::Name(GetFocusCtrl()));
}
void LayDes::Group(Bar& bar, const String& group)
@ -776,7 +775,6 @@ void LayDes::Group(Bar& bar, const String& group)
if((q++ + 2) % 16 == 0)
bar.Break();
}
LOG("End " << ::Name(GetFocusCtrl()));
}
void LayDes::TemplateGroup(Bar& bar, TempGroup tg)