diff options
| author | Matthias Melcher <fltk@matthiasm.com> | 2005-11-04 15:16:24 +0000 |
|---|---|---|
| committer | Matthias Melcher <fltk@matthiasm.com> | 2005-11-04 15:16:24 +0000 |
| commit | 7f6bacf2374d8e82a31cdbfd8fcf5ff18e97a55b (patch) | |
| tree | d526ddd1207e9fd9363f56c54039a614e2071959 /fluid/Fl_Function_Type.cxx | |
| parent | d24609eafb56c0c41f0aa72f2b44ee95df6bc2ad (diff) | |
FLUID1: The comment entry in the Browser now reveals some more information by showing multiple lines up to 50 characters. Also, a change just to make sure our Code View won't harm.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@4638 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'fluid/Fl_Function_Type.cxx')
| -rw-r--r-- | fluid/Fl_Function_Type.cxx | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/fluid/Fl_Function_Type.cxx b/fluid/Fl_Function_Type.cxx index d5627b2a8..77391abc1 100644 --- a/fluid/Fl_Function_Type.cxx +++ b/fluid/Fl_Function_Type.cxx @@ -681,6 +681,7 @@ Fl_Type *Fl_Comment_Type::make() { o->name("my comment"); o->add(p); o->factory = this; + o->title_buf[0] = 0; return o; } @@ -835,9 +836,31 @@ void Fl_Comment_Type::open() { break; } BREAK2: + title_buf[0] = 0; comment_panel->hide(); } +const char *Fl_Comment_Type::title() { + const char* n = name(); + if (!n || !*n) return type_name(); + if (title_buf[0]==0) { + const char *s = n; + char *d = title_buf; + int i = 50; + while (--i > 0) { + char n = *s++; + if (n==0) break; + if (n=='\r') { *d++ = '\\'; *d++ = 'r'; i--; } + else if (n=='\n') { *d++ = '\\'; *d++ = 'n'; i--; } + else if (n<32) { *d++ = '^'; *d++ = 'A'+n; i--; } + else *d++ = n; + } + if (i<=0) { *d++ = '.'; *d++ = '.'; *d++ = '.'; } + *d++ = 0; + } + return title_buf; +} + Fl_Comment_Type Fl_Comment_type; void Fl_Comment_Type::write_code1() { |
