diff --git a/uppsrc/CtrlCore/CtrlKbd.cpp b/uppsrc/CtrlCore/CtrlKbd.cpp index c034b7c9d..a508a0d77 100644 --- a/uppsrc/CtrlCore/CtrlKbd.cpp +++ b/uppsrc/CtrlCore/CtrlKbd.cpp @@ -142,8 +142,8 @@ void Ctrl::DoDeactivate(Ptr pfocusCtrl, Ptr nfocusCtrl) if(pfocusCtrl) { Ptr 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 pfocusCtrl, Ptr 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 __; diff --git a/uppsrc/CtrlCore/GtkWnd.cpp b/uppsrc/CtrlCore/GtkWnd.cpp index d26bec428..4f256a52e 100644 --- a/uppsrc/CtrlCore/GtkWnd.cpp +++ b/uppsrc/CtrlCore/GtkWnd.cpp @@ -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; diff --git a/uppsrc/CtrlCore/Win32Wnd.cpp b/uppsrc/CtrlCore/Win32Wnd.cpp index d32beafc7..4a5c9fad6 100644 --- a/uppsrc/CtrlCore/Win32Wnd.cpp +++ b/uppsrc/CtrlCore/Win32Wnd.cpp @@ -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(); diff --git a/uppsrc/CtrlLib/DocEdit.cpp b/uppsrc/CtrlLib/DocEdit.cpp index dff3e8755..9bb9c8519 100644 --- a/uppsrc/CtrlLib/DocEdit.cpp +++ b/uppsrc/CtrlLib/DocEdit.cpp @@ -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() {} diff --git a/uppsrc/ide/Builders/CppBuilder.cpp b/uppsrc/ide/Builders/CppBuilder.cpp index c661f9e2a..d36c80850 100644 --- a/uppsrc/ide/Builders/CppBuilder.cpp +++ b/uppsrc/ide/Builders/CppBuilder.cpp @@ -251,15 +251,11 @@ void ExtExclude(CParser& p, Index& x) Vector 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 CppBuilder::CustomStep(const String& pf, const String& package_, Vector dirs; sGatherAllExt(files, dirs, GetFileFolder(path), ""); - DDUMPC(dirs); - Index 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 out; Index include_path; String f = LoadFile(path); @@ -337,13 +329,9 @@ Vector CppBuilder::CustomStep(const String& pf, const String& package_, return Vector(); } - 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 o; for(int i = 0; i < out.GetCount(); i++) o.Add(SourcePath(package, out[i])); diff --git a/uppsrc/ide/Builders/MscBuilder.icpp b/uppsrc/ide/Builders/MscBuilder.icpp index 9c3ed4827..147329017 100644 --- a/uppsrc/ide/Builders/MscBuilder.icpp +++ b/uppsrc/ide/Builders/MscBuilder.icpp @@ -289,8 +289,6 @@ bool MscBuilder::BuildPackage(const String& package, Vector& linkfile, V cc = cc_speed; } - DDUMPC(sfile); - int recompile = 0; Blitz b; if(blitz) { diff --git a/uppsrc/ide/LayDes/laydes.cpp b/uppsrc/ide/LayDes/laydes.cpp index 233e8feb5..16176380f 100644 --- a/uppsrc/ide/LayDes/laydes.cpp +++ b/uppsrc/ide/LayDes/laydes.cpp @@ -7,6 +7,7 @@ using namespace LayoutKeys; #include #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)