CtrlCore: Fixed workares issue in X11/GTK, various cosmetics

git-svn-id: svn://ultimatepp.org/upp/trunk@7336 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2014-04-28 16:55:48 +00:00
parent f59fe47620
commit e2b5d44cc8
32 changed files with 87 additions and 56 deletions

View file

@ -323,12 +323,13 @@ void CodeEditor::IndentEnter(int count) {
const wchar *s = pl; const wchar *s = pl;
while(*s == '\t' || *s == ' ') while(*s == '\t' || *s == ' ')
InsertChar(*s++, 1); InsertChar(*s++, 1);
if(st.stmtline == cl || st.blk.GetCount() && st.blk.Top() == cl) if(st.stmtline == cl || st.blk.GetCount() && st.blk.Top() == cl) {
if(indent_spaces || (s > pl && s[-1] == ' ')) if(indent_spaces || (s > pl && s[-1] == ' '))
InsertChar(' ', indent_amount); InsertChar(' ', indent_amount);
else else
InsertChar('\t', 1); InsertChar('\t', 1);
} }
}
} }
void CodeEditor::IndentInsert(int chr) { void CodeEditor::IndentInsert(int chr) {
@ -512,7 +513,7 @@ void CodeEditor::MoveNextBrk(bool sel) {
void CodeEditor::MovePrevBrk(bool sel) { void CodeEditor::MovePrevBrk(bool sel) {
int p = GetCursor(); int p = GetCursor();
if(p < 2) return; if(p < 2) return;
if(!isrbrkt(GetChar(p - 1))) if(!isrbrkt(GetChar(p - 1))) {
if(p < GetLength() - 1 && isrbrkt(GetChar(p))) if(p < GetLength() - 1 && isrbrkt(GetChar(p)))
p++; p++;
else { else {
@ -520,6 +521,7 @@ void CodeEditor::MovePrevBrk(bool sel) {
PlaceCaret(p, sel); PlaceCaret(p, sel);
return; return;
} }
}
int lvl = 1; int lvl = 1;
p -= 2; p -= 2;
for(;;) { for(;;) {

View file

@ -160,7 +160,7 @@ bool CodeEditor::FindFrom(int pos, bool back, const wchar *text, bool wholeword,
ft.Cat(c); ft.Cat(c);
} }
else else
if(c >= ' ') if(c >= ' ') {
if(wildcards) if(wildcards)
ft.Cat(c == '*' ? WILDANY : ft.Cat(c == '*' ? WILDANY :
c == '?' ? WILDONE : c == '?' ? WILDONE :
@ -172,6 +172,7 @@ bool CodeEditor::FindFrom(int pos, bool back, const wchar *text, bool wholeword,
else else
ft.Cat(c); ft.Cat(c);
} }
}
bool wb = wholeword ? iscidl(*ft) : false; bool wb = wholeword ? iscidl(*ft) : false;
bool we = wholeword ? iscidl(*ft.Last()) : false; bool we = wholeword ? iscidl(*ft.Last()) : false;
if(ft.IsEmpty()) return false; if(ft.IsEmpty()) return false;

View file

@ -161,8 +161,8 @@ void CodeEditor::SyntaxState::ScanSyntax(const wchar *ln, const wchar *e, int ta
break; break;
case 4: case 4:
if(id[0] == 'e' && id[1] == 'l') if(id[0] == 'e' && id[1] == 'l') {
if(id[2] == 'i' && id[3] == 'f') if(id[2] == 'i' && id[3] == 'f') {
if(ifstack.GetCount() == 0) { if(ifstack.GetCount() == 0) {
IfState& ifstate = ifstack.Add(); IfState& ifstate = ifstack.Add();
ifstate.ifline = 0; ifstate.ifline = 0;
@ -177,8 +177,9 @@ void CodeEditor::SyntaxState::ScanSyntax(const wchar *ln, const wchar *e, int ta
else else
ifstate.state = IfState::ELSE_ERROR; ifstate.state = IfState::ELSE_ERROR;
} }
}
else else
if(id[2] == 's' && id[3] == 'e') if(id[2] == 's' && id[3] == 'e') {
if(ifstack.GetCount() == 0) { if(ifstack.GetCount() == 0) {
IfState& ifstate = ifstack.Add(); IfState& ifstate = ifstack.Add();
ifstate.ifline = 0; ifstate.ifline = 0;
@ -193,6 +194,8 @@ void CodeEditor::SyntaxState::ScanSyntax(const wchar *ln, const wchar *e, int ta
else else
ifstate.state = IfState::ELSE_ERROR; ifstate.state = IfState::ELSE_ERROR;
} }
}
}
break; break;
case 5: case 5:

View file

@ -110,8 +110,8 @@ inline void LOGF(const char *format, ...) {}
#define NEVER() LOG_NOP #define NEVER() LOG_NOP
#define NEVER_(msg) LOG_NOP #define NEVER_(msg) LOG_NOP
#define XNEVER(d) LOG_NOP #define XNEVER(d) LOG_NOP
#define CHECK(c) (c) #define CHECK(c) (void)(c)
#define XCHECK(c, d) (c) #define XCHECK(c, d) (void)(c)
#define TIMING(x) LOG_NOP #define TIMING(x) LOG_NOP
#define HITCOUNT(x) LOG_NOP #define HITCOUNT(x) LOG_NOP

View file

@ -13,7 +13,7 @@ void SystemDraw::BeginOp()
Vector<Rect> newclip; Vector<Rect> newclip;
newclip <<= clip.Top(); newclip <<= clip.Top();
f.clipi = clip.GetCount(); f.clipi = clip.GetCount();
clip.Add() = newclip; clip.Add() = pick(newclip);
cloff.Add(f); cloff.Add(f);
} }
@ -35,7 +35,7 @@ bool SystemDraw::ClipOp(const Rect& r)
Vector<Rect> newclip = Intersect(clip.Top(), r + actual_offset, ch); Vector<Rect> newclip = Intersect(clip.Top(), r + actual_offset, ch);
if(ch) { if(ch) {
f.clipi = clip.GetCount(); f.clipi = clip.GetCount();
clip.Add() = newclip; clip.Add() = pick(newclip);
} }
cloff.Add(f); cloff.Add(f);
if(ch) if(ch)
@ -51,7 +51,7 @@ bool SystemDraw::ClipoffOp(const Rect& r)
Vector<Rect> newclip = Intersect(clip.Top(), r + actual_offset, ch); Vector<Rect> newclip = Intersect(clip.Top(), r + actual_offset, ch);
if(ch) { if(ch) {
f.clipi = clip.GetCount(); f.clipi = clip.GetCount();
clip.Add() = newclip; clip.Add() = pick(newclip);
} }
f.offseti = offset.GetCount(); f.offseti = offset.GetCount();
actual_offset += r.TopLeft(); actual_offset += r.TopLeft();
@ -80,7 +80,7 @@ bool SystemDraw::ExcludeClipOp(const Rect& r)
bool ch = false; bool ch = false;
Vector<Rect> ncl = Subtract(cl, r + actual_offset, ch); Vector<Rect> ncl = Subtract(cl, r + actual_offset, ch);
if(ch) { if(ch) {
cl = ncl; cl = pick(ncl);
SetClip(); SetClip();
} }
return clip.Top().GetCount(); return clip.Top().GetCount();
@ -93,7 +93,7 @@ bool SystemDraw::IntersectClipOp(const Rect& r)
bool ch = false; bool ch = false;
Vector<Rect> ncl = Intersect(cl, r + actual_offset, ch); Vector<Rect> ncl = Intersect(cl, r + actual_offset, ch);
if(ch) { if(ch) {
cl = ncl; cl = pick(ncl);
SetClip(); SetClip();
} }
return clip.Top().GetCount(); return clip.Top().GetCount();

View file

@ -58,7 +58,7 @@ void TopWindow::SyncCaption()
void TopWindow::CenterRect(Ctrl *owner) void TopWindow::CenterRect(Ctrl *owner)
{ {
GuiLock __; GuiLock __;
SetupRect(); SetupRect(owner);
if(owner && center == 1 || center == 2) { if(owner && center == 1 || center == 2) {
Size sz = GetRect().Size(); Size sz = GetRect().Size();
Rect r, wr; Rect r, wr;

View file

@ -157,10 +157,10 @@ void TopWindow::SyncCaption()
#endif #endif
} }
void TopWindow::CenterRect(HWND hwnd, int center) void TopWindow::CenterRect(HWND hwnd, int center, Ctrl *owner)
{ {
GuiLock __; GuiLock __;
SetupRect(); SetupRect(owner);
if(hwnd && center == 1 || center == 2) { if(hwnd && center == 1 || center == 2) {
Size sz = GetRect().Size(); Size sz = GetRect().Size();
Rect frmrc(sz); Rect frmrc(sz);

View file

@ -145,14 +145,14 @@ void TopWindow::RejectBreak(int ID)
Break(ID); Break(ID);
} }
void TopWindow::SetupRect() void TopWindow::SetupRect(Ctrl *owner)
{ {
Rect r = GetRect(); Rect r = GetRect();
if(r.IsEmpty()) if(r.IsEmpty())
SetRect(GetDefaultWindowRect()); SetRect(GetDefaultWindowRect());
else else
if(r.left == 0 && r.top == 0 && center == 1) { if(r.left == 0 && r.top == 0 && center == 1) {
Rect area = Ctrl::GetWorkArea(); Rect area = owner ? owner->GetWorkArea() : Ctrl::GetWorkArea();
SetRect(area.CenterRect(min(area.Size(), r.Size()))); SetRect(area.CenterRect(min(area.Size(), r.Size())));
} }
} }

View file

@ -59,7 +59,7 @@ private:
void SyncTitle(); void SyncTitle();
void SyncCaption(); void SyncCaption();
void SetupRect(); void SetupRect(Ctrl *owner);
void FixIcons(); void FixIcons();

View file

@ -8,7 +8,7 @@ private:
HICON ico, lico; HICON ico, lico;
void DeleteIco(); void DeleteIco();
void CenterRect(HWND owner, int center); void CenterRect(HWND owner, int center, Ctrl *owner);
public: public:
void Open(HWND ownerhwnd); void Open(HWND ownerhwnd);

View file

@ -97,12 +97,12 @@ void Ctrl::EventProc(XWindow& w, XEvent *event)
if(top) { if(top) {
Window DestW = (parent ? GetParentWindow() : Xroot); Window DestW = (parent ? GetParentWindow() : Xroot);
XTranslateCoordinates(Xdisplay, top->window, DestW, 0, 0, &x, &y, &dummy); XTranslateCoordinates(Xdisplay, top->window, DestW, 0, 0, &x, &y, &dummy);
}
Rect rect = RectC(x, y, e.width, e.height); Rect rect = RectC(x, y, e.width, e.height);
LLOG("CongigureNotify " << rect); LLOG("CongigureNotify " << rect);
if(GetRect() != rect) if(GetRect() != rect)
SetWndRect(rect); SetWndRect(rect);
// Synchronizes native windows (NOT the main one) // Synchronizes native windows (NOT the main one)
}
SyncNativeWindows(); SyncNativeWindows();
// 01/12/2007 - END // 01/12/2007 - END

View file

@ -237,8 +237,8 @@ Buffer<unsigned long> TopWindow::PreperIcon(const Image& icon, int& len) {
void TopWindow::CenterRect(Ctrl *owner) void TopWindow::CenterRect(Ctrl *owner)
{ {
GuiLock __; GuiLock __;
SetupRect(); SetupRect(owner);
if((owner&& center == 1) || center == 2) { if((owner && center == 1) || center == 2) {
Rect r, wr; Rect r, wr;
wr = Ctrl::GetWorkArea(); wr = Ctrl::GetWorkArea();
Size sz = GetRect().Size(); Size sz = GetRect().Size();

View file

@ -328,7 +328,7 @@ void Ctrl::TimerAndPaint() {
if(xw.ctrl) { if(xw.ctrl) {
LLOG("..and paint " << UPP::Name(xw.ctrl)); LLOG("..and paint " << UPP::Name(xw.ctrl));
xw.ctrl->SyncScroll(); xw.ctrl->SyncScroll();
Vector<Rect> x = xw.invalid; Vector<Rect> x = pick(xw.invalid);
xw.invalid.Clear(); xw.invalid.Clear();
xw.ctrl->DoPaint(x); xw.ctrl->DoPaint(x);
} }

View file

@ -67,11 +67,12 @@ void TextCompareCtrl::LeftDouble(Point pt, dword keyflags)
void TextCompareCtrl::MouseMove(Point pt, dword flags) void TextCompareCtrl::MouseMove(Point pt, dword flags)
{ {
if(HasCapture()) if(HasCapture()) {
if(gutter_capture) if(gutter_capture)
LeftDown(pt, flags); LeftDown(pt, flags);
else else
DoSelection(pt.y, true); DoSelection(pt.y, true);
}
} }
void TextCompareCtrl::LeftUp(Point pt, dword keyflags) void TextCompareCtrl::LeftUp(Point pt, dword keyflags)

View file

@ -383,7 +383,7 @@ bool AssistEditor::IncludeAssist()
FindFile ff(AppendFileName(AppendFileName(include[i], include_path), "*.*")); FindFile ff(AppendFileName(AppendFileName(include[i], include_path), "*.*"));
while(ff) { while(ff) {
String fn = ff.GetName(); String fn = ff.GetName();
if(!ff.IsHidden()) if(!ff.IsHidden()) {
if(ff.IsFolder()) { if(ff.IsFolder()) {
folder.Add(fn); folder.Add(fn);
upper_folder.Add(ToUpper(fn)); upper_folder.Add(ToUpper(fn));
@ -396,6 +396,7 @@ bool AssistEditor::IncludeAssist()
upper_file.Add(ToUpper(fn)); upper_file.Add(ToUpper(fn));
} }
} }
}
ff.Next(); ff.Next();
} }
} }
@ -577,7 +578,7 @@ void AssistEditor::Complete2()
Vector<String> id = GetFileIds(); Vector<String> id = GetFileIds();
for(int i = 0; i < id.GetCount(); i++) { for(int i = 0; i < id.GetCount(); i++) {
String s = id[i]; String s = id[i];
if(s.StartsWith(q)) if(s.StartsWith(q)) {
if(IsNull(h)) if(IsNull(h))
h = s; h = s;
else { else {
@ -589,6 +590,7 @@ void AssistEditor::Complete2()
} }
} }
} }
}
if(h.GetCount() > q.GetCount()) if(h.GetCount() > q.GetCount())
Paste(h.Mid(q.GetCount()).ToWString()); Paste(h.Mid(q.GetCount()).ToWString());
} }
@ -742,20 +744,22 @@ bool AssistEditor::Key(dword key, int count)
if(popup.IsOpen()) { if(popup.IsOpen()) {
int k = key & ~K_CTRL; int k = key & ~K_CTRL;
ArrayCtrl& kt = key & K_CTRL ? type : assist; ArrayCtrl& kt = key & K_CTRL ? type : assist;
if(k == K_UP || k == K_PAGEUP || k == K_CTRL_PAGEUP || k == K_CTRL_END) if(k == K_UP || k == K_PAGEUP || k == K_CTRL_PAGEUP || k == K_CTRL_END) {
if(kt.IsCursor()) if(kt.IsCursor())
return kt.Key(k, count); return kt.Key(k, count);
else { else {
kt.SetCursor(kt.GetCount() - 1); kt.SetCursor(kt.GetCount() - 1);
return true; return true;
} }
if(k == K_DOWN || k == K_PAGEDOWN || k == K_CTRL_PAGEDOWN || k == K_CTRL_HOME) }
if(k == K_DOWN || k == K_PAGEDOWN || k == K_CTRL_PAGEDOWN || k == K_CTRL_HOME) {
if(kt.IsCursor()) if(kt.IsCursor())
return kt.Key(k, count); return kt.Key(k, count);
else { else {
kt.SetCursor(0); kt.SetCursor(0);
return true; return true;
} }
}
if(key == K_ENTER && assist.IsCursor()) { if(key == K_ENTER && assist.IsCursor()) {
AssistInsert(); AssistInsert();
return true; return true;
@ -950,7 +954,7 @@ void AssistEditor::DCopy()
decl = false; decl = false;
for(int j = 0; j < n.GetCount(); j++) { for(int j = 0; j < n.GetCount(); j++) {
const CppItem& m = n[j]; const CppItem& m = n[j];
if(m.IsCode()) if(m.IsCode()) {
if(decl) if(decl)
r << MakeDefinition(cls, m.natural) << "\n{\n}\n\n"; r << MakeDefinition(cls, m.natural) << "\n{\n}\n\n";
else { else {
@ -958,6 +962,7 @@ void AssistEditor::DCopy()
r << String('\t', Split(cpp.GetKey(i), ':').GetCount()); r << String('\t', Split(cpp.GetKey(i), ':').GetCount());
r << m.natural << ";\n"; r << m.natural << ";\n";
} }
}
if(m.IsData()) { if(m.IsData()) {
if(cls.GetCount()) { if(cls.GetCount()) {
const char *s = m.natural; const char *s = m.natural;

View file

@ -52,7 +52,7 @@ struct ScopeLess {
String CodeBrowser::GetPm() String CodeBrowser::GetPm()
{ {
String pm; String pm;
if(TheIde() && range) if(TheIde() && range) {
if(range == 1) if(range == 1)
pm = TheIde()->IdeGetNestFolder(); pm = TheIde()->IdeGetNestFolder();
else { else {
@ -60,6 +60,7 @@ String CodeBrowser::GetPm()
if(range == 2) if(range == 2)
pm = GetFileFolder(pm); pm = GetFileFolder(pm);
} }
}
return pm; return pm;
} }

View file

@ -146,11 +146,12 @@ void SaveGroupInc(const String& grouppath)
gh << "END_TOPIC\r\n\r\n"; gh << "END_TOPIC\r\n\r\n";
} }
String fn = AppendFileName(AppendFileName(packagedir, group + ".tpp"), "all.i"); String fn = AppendFileName(AppendFileName(packagedir, group + ".tpp"), "all.i");
if(LoadFile(fn) != gh) if(LoadFile(fn) != gh) {
if(IsNull(gh)) if(IsNull(gh))
DeleteFile(fn); DeleteFile(fn);
else else
SaveFile(fn, gh); SaveFile(fn, gh);
}
} }
void SetTopicGroupIncludeable(const char *path, bool set) void SetTopicGroupIncludeable(const char *path, bool set)

View file

@ -121,12 +121,13 @@ void TopicEditor::SaveTopic()
WString t; WString t;
for(int i = 0; i < para.GetCount(); i++) for(int i = 0; i < para.GetCount(); i++)
if(para[i].IsText()) if(para[i].IsText())
for(const wchar *s = para[i].text; *s; s++) for(const wchar *s = para[i].text; *s; s++) {
if(*s == '\t' || *s == 160) if(*s == '\t' || *s == 160)
t.Cat(' '); t.Cat(' ');
else else
if(*s >= ' ') if(*s >= ' ')
t.Cat(*s); t.Cat(*s);
}
if(!IsNull(t)) if(!IsNull(t))
title <<= t; title <<= t;
} }

View file

@ -61,11 +61,12 @@ void Ide::EndBuilding(bool ok)
PutConsole(""); PutConsole("");
PutConsole((ok ? "OK. " : "There were errors. ") + GetPrintTime(build_time)); PutConsole((ok ? "OK. " : "There were errors. ") + GetPrintTime(build_time));
SetIdeState(EDITING); SetIdeState(EDITING);
if(GetTopWindow()->IsOpen()) if(GetTopWindow()->IsOpen()) {
if(ok) if(ok)
BeepMuteInformation(); BeepMuteInformation();
else else
BeepMuteExclamation(); BeepMuteExclamation();
}
ShowConsole(); ShowConsole();
} }

View file

@ -633,11 +633,11 @@ void MakeBuild::SaveMakeFile(const String& fn, bool exporting)
<< "\tif [ -d $(UPPOUT) ]; then rm -rf $(UPPOUT); fi;\n"; << "\tif [ -d $(UPPOUT) ]; then rm -rf $(UPPOUT); fi;\n";
bool sv = ::SaveFile(fn, makefile); bool sv = ::SaveFile(fn, makefile);
if(!exporting) if(!exporting) {
if(sv) if(sv)
PutConsole(NFormat("%s(1): makefile generation complete", fn)); PutConsole(NFormat("%s(1): makefile generation complete", fn));
else else
PutConsole(NFormat("%s: error writing makefile", fn)); PutConsole(NFormat("%s: error writing makefile", fn));
}
EndBuilding(true); EndBuilding(true);
} }

View file

@ -473,13 +473,14 @@ bool GccBuilder::Link(const Vector<String>& linkfile, const String& linkoptions,
lnk << ' ' << GetHostPathQ(FindInDirs(libpath, lib[i])); lnk << ' ' << GetHostPathQ(FindInDirs(libpath, lib[i]));
} }
else else
if(ext != ".a") if(ext != ".a") {
if(ext == ".so" || ext == ".dll" || ext == ".lib") if(ext == ".so" || ext == ".dll" || ext == ".lib")
lnk << ' ' << GetHostPathQ(FindInDirs(libpath, lib[i])); lnk << ' ' << GetHostPathQ(FindInDirs(libpath, lib[i]));
else else
lnk << " -l" << ln; lnk << " -l" << ln;
} }
} }
}
PutConsole("Linking..."); PutConsole("Linking...");
bool error = false; bool error = false;
CustomStep(".pre-link", Null, error); CustomStep(".pre-link", Null, error);

View file

@ -149,11 +149,12 @@ bool JavaBuilder::BuildPackage(const String& package, Vector<String>& linkfile,
String linkcmd; String linkcmd;
linkcmd << "javac"; linkcmd << "javac";
linkcmd << (HasFlag("DEBUG") ? " -g" : " -g:none"); linkcmd << (HasFlag("DEBUG") ? " -g" : " -g:none");
if(!HasFlag("DEBUG")) if(!HasFlag("DEBUG")) {
if(!IsNull(release_options)) if(!IsNull(release_options))
linkcmd << ' ' << release_options; linkcmd << ' ' << release_options;
else else
linkcmd << " -O"; linkcmd << " -O";
}
linkcmd << " -deprecation" << linkoptions << " -sourcepath "; linkcmd << " -deprecation" << linkoptions << " -sourcepath ";
bool win32 = HasFlag("WIN32"); bool win32 = HasFlag("WIN32");
for(i = 0; i < linkfile.GetCount(); i++) { for(i = 0; i < linkfile.GetCount(); i++) {

View file

@ -146,7 +146,7 @@ void LayoutItem::ReadProperties(CParser& p, bool addunknown)
else { else {
String name = p.ReadId(); String name = p.ReadId();
int q = FindProperty(name); int q = FindProperty(name);
if(q < 0) if(q < 0) {
if(addunknown) { if(addunknown) {
q = property.GetCount(); q = property.GetCount();
ItemProperty& new_prop = property.Add(new RawProperty); ItemProperty& new_prop = property.Add(new RawProperty);
@ -158,6 +158,7 @@ void LayoutItem::ReadProperties(CParser& p, bool addunknown)
ReadPropertyParam(p); ReadPropertyParam(p);
p.PassChar(')'); p.PassChar(')');
} }
}
if(q >= 0) { if(q >= 0) {
ItemProperty& ip = property[q]; ItemProperty& ip = property[q];
ip.SetCharset(charset); ip.SetCharset(charset);

View file

@ -509,11 +509,12 @@ void SelectPackageDlg::SyncBase(String initvars)
Sort(varlist, &PackageLess); Sort(varlist, &PackageLess);
base.Clear(); base.Clear();
Append(base, varlist); Append(base, varlist);
if(!base.FindSetCursor(initvars)) if(!base.FindSetCursor(initvars)) {
if(base.GetCount() > 0) if(base.GetCount() > 0)
base.SetCursor(0); base.SetCursor(0);
else else
OnBase(); OnBase();
}
} }
bool SelectPackageDlg::Pless(const SelectPackageDlg::PkInfo& a, const SelectPackageDlg::PkInfo& b) bool SelectPackageDlg::Pless(const SelectPackageDlg::PkInfo& a, const SelectPackageDlg::PkInfo& b)

View file

@ -255,11 +255,12 @@ void WorkspaceWork::LoadActualPackage()
} }
} }
Image m = IdeFileImage(f, f.optimize_speed); Image m = IdeFileImage(f, f.optimize_speed);
if(GetFileExt(p) == ".tpp" && IsFolder(p)) if(GetFileExt(p) == ".tpp" && IsFolder(p)) {
if(FileExists(AppendFileName(p, "all.i"))) if(FileExists(AppendFileName(p, "all.i")))
m = TopicImg::IGroup(); m = TopicImg::IGroup();
else else
m = TopicImg::Group(); m = TopicImg::Group();
}
#ifdef PLATFORM_WIN32 #ifdef PLATFORM_WIN32
p = ToLower(p); p = ToLower(p);
#endif #endif

View file

@ -738,12 +738,13 @@ void Ide::SetIcon()
return; return;
} }
else else
if((GetTimeClick() / 800) & 1) if((GetTimeClick() / 800) & 1) {
if(debugger) if(debugger)
new_state_icon = 2; new_state_icon = 2;
else else
if(idestate == BUILDING) if(idestate == BUILDING)
new_state_icon = 3; new_state_icon = 3;
}
if(state_icon == new_state_icon) if(state_icon == new_state_icon)
return; return;
state_icon = new_state_icon; state_icon = new_state_icon;

View file

@ -98,7 +98,7 @@ mainconfig
"" = "GUI CHECKCLIPBOARD", "" = "GUI CHECKCLIPBOARD",
"" = "GUI SVO_VALUE", "" = "GUI SVO_VALUE",
"" = "GUI GTK", "" = "GUI GTK",
"" = "GUI X11", "" = "GUI MT X11",
"" = "GUI MT NOGTK", "" = "GUI MT NOGTK",
"" = "GUI NOGTK"; "" = "GUI NOGTK";

View file

@ -252,12 +252,13 @@ void Ide::MacroMenu(Bar& menu)
VectorMap< String, Vector<int> > submenu_map; VectorMap< String, Vector<int> > submenu_map;
for(int i = 0; i < mlist.GetCount(); i++) { for(int i = 0; i < mlist.GetCount(); i++) {
const IdeMacro& m = mlist[i]; const IdeMacro& m = mlist[i];
if(!IsNull(m.menu)) if(!IsNull(m.menu)) {
if(IsNull(m.submenu)) if(IsNull(m.submenu))
submenu_map.GetAdd(Null).Add(i); submenu_map.GetAdd(Null).Add(i);
else else
submenu_map.GetAdd(m.menu).Add(i); submenu_map.GetAdd(m.menu).Add(i);
} }
}
if(!submenu_map.IsEmpty()) { if(!submenu_map.IsEmpty()) {
Vector<int> order = GetSortOrder(submenu_map.GetKeys()); Vector<int> order = GetSortOrder(submenu_map.GetKeys());
for(int o = 0; o < order.GetCount(); o++) { for(int o = 0; o < order.GetCount(); o++) {
@ -331,13 +332,14 @@ void Ide::Setup(Bar& menu) {
menu.Add("Source managment..", THISBACK(AutoSetup)) menu.Add("Source managment..", THISBACK(AutoSetup))
.Help("Source code updater settings.."); .Help("Source code updater settings..");
menu.Separator(); menu.Separator();
if(UpdaterCfg().method%2==0) //local copy or svn if(UpdaterCfg().method%2==0) { //local copy or svn
if(UpdaterCfg().available) if(UpdaterCfg().available)
menu.Add("Install updates..", IdeImg::install_updates(), THISBACK(CheckUpdatesManual)) menu.Add("Install updates..", IdeImg::install_updates(), THISBACK(CheckUpdatesManual))
.Help("Install newer version of source codes.."); .Help("Install newer version of source codes..");
else else
menu.Add("Check for updates..", IdeImg::check_updates(), THISBACK(CheckUpdatesManual)) menu.Add("Check for updates..", IdeImg::check_updates(), THISBACK(CheckUpdatesManual))
.Help("Check for availability of newer source codes.."); .Help("Check for availability of newer source codes..");
}
#endif #endif
} }
@ -378,11 +380,12 @@ void Ide::Project(Bar& menu) {
if(OldLang()) if(OldLang())
menu.Add("Convert s_ -> t_", THISBACK(ConvertST)); menu.Add("Convert s_ -> t_", THISBACK(ConvertST));
FilePropertiesMenu(menu); FilePropertiesMenu(menu);
if(SvnDirs(true).GetCount()) if(SvnDirs(true).GetCount()) {
if(menu.IsMenuBar()) if(menu.IsMenuBar())
menu.Add("SVN", THISBACK(ProjectSvn)); menu.Add("SVN", THISBACK(ProjectSvn));
else else
menu.Add("SVN Synchronize everything..", IdeImg::svn(), THISBACK(SyncSvn)); menu.Add("SVN Synchronize everything..", IdeImg::svn(), THISBACK(SyncSvn));
}
} }
void Ide::FilePropertiesMenu(Bar& menu) void Ide::FilePropertiesMenu(Bar& menu)

View file

@ -85,11 +85,12 @@ bool LngParseTFile(const String& fn, VectorMap<String, LngEntry>& lng)
CParser p(data, fn); CParser p(data, fn);
try { try {
if(p.Char('#')) if(p.Char('#'))
while(!p.IsEof()) while(!p.IsEof()) {
if(p.IsChar2('T', '_')) if(p.IsChar2('T', '_'))
break; break;
else else
p.SkipTerm(); p.SkipTerm();
}
String id; String id;
while(!p.IsEof()) { while(!p.IsEof()) {
if(p.Id("T_")) { if(p.Id("T_")) {

View file

@ -991,7 +991,7 @@ WString ASBeautifier::beautify(const WString &originalLine)
} }
// handle quotes (such as 'x' and "Hello Dolly") // handle quotes (such as 'x' and "Hello Dolly")
if (!(isInComment || isInLineComment) && (ch == '"' || ch == '\'')) if (!(isInComment || isInLineComment) && (ch == '"' || ch == '\'')) {
if (!isInQuote) if (!isInQuote)
{ {
quoteChar = ch; quoteChar = ch;
@ -1003,6 +1003,7 @@ WString ASBeautifier::beautify(const WString &originalLine)
isInStatement = true; isInStatement = true;
continue; continue;
} }
}
if (isInQuote) if (isInQuote)
continue; continue;
@ -1621,11 +1622,12 @@ WString ASBeautifier::beautify(const WString &originalLine)
// that both an assignment op and a non-assignment op where found, // that both an assignment op and a non-assignment op where found,
// e.g. '>>' and '>>='. If this is the case, treat the LONGER one as the // e.g. '>>' and '>>='. If this is the case, treat the LONGER one as the
// found operator. // found operator.
if (foundAssignmentOp != NULL && foundNonAssignmentOp != NULL) if (foundAssignmentOp != NULL && foundNonAssignmentOp != NULL) {
if (foundAssignmentOp->GetCount() < foundNonAssignmentOp->GetCount()) if (foundAssignmentOp->GetCount() < foundNonAssignmentOp->GetCount())
foundAssignmentOp = NULL; foundAssignmentOp = NULL;
else else
foundNonAssignmentOp = NULL; foundNonAssignmentOp = NULL;
}
if (foundNonAssignmentOp != NULL) if (foundNonAssignmentOp != NULL)
{ {

View file

@ -217,7 +217,7 @@ void ASEnhancer::enhance(WString &line)
} }
// handle quotes (such as 'x' and "Hello Dolly") // handle quotes (such as 'x' and "Hello Dolly")
if (!(isInComment) && (ch == '"' || ch == '\'')) if (!(isInComment) && (ch == '"' || ch == '\'')) {
if (!isInQuote) if (!isInQuote)
{ {
quoteChar = ch; quoteChar = ch;
@ -228,6 +228,7 @@ void ASEnhancer::enhance(WString &line)
isInQuote = false; isInQuote = false;
continue; continue;
} }
}
if (isInQuote) if (isInQuote)
continue; continue;
@ -335,12 +336,13 @@ void ASEnhancer::enhance(WString &line)
} }
for (; i < lineLength; i++) // bypass colon for (; i < lineLength; i++) // bypass colon
{ {
if (line[i] == ':') if (line[i] == ':') {
if ((i + 1 < lineLength) && (line[i + 1] == ':')) if ((i + 1 < lineLength) && (line[i + 1] == ':'))
i++; // bypass scope resolution operator i++; // bypass scope resolution operator
else else
break; break;
} }
}
i++; i++;
for (; i < lineLength; i++) // bypass whitespace for (; i < lineLength; i++) // bypass whitespace
{ {

View file

@ -237,11 +237,12 @@ void MoveSvn(const String& path, const String& tp)
String nm = ff.GetName(); String nm = ff.GetName();
String s = AppendFileName(path, nm); String s = AppendFileName(path, nm);
String t = AppendFileName(tp, nm); String t = AppendFileName(tp, nm);
if(ff.IsFolder()) if(ff.IsFolder()) {
if(nm == ".svn") if(nm == ".svn")
FileMove(s, t); FileMove(s, t);
else else
MoveSvn(s, t); MoveSvn(s, t);
}
ff.Next(); ff.Next();
} }
} }