FLTK logo

STR #762

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 Home  |  Articles & FAQs  |  Bugs & Features  |  Documentation  |  Download  |  Screenshots  ]
 

Return to Bugs & Features | Roadmap 1.1 | SVN ⇄ GIT ]

STR #762

Application:FLTK Library
Status:1 - Closed w/Resolution
Priority:2 - Low, e.g. a documentation error or undocumented side-effect
Scope:3 - Applies to all machines and operating systems
Subsystem:Core Library
Summary:Minor layout issues with scrollbars in Fl_Text_Editor
Version:1.1.6
Created By:Portale
Assigned To:matt
Fix Version:1.1-current
Update Notification:

Receive EMails Don't Receive EMails

Trouble Report Files:


Name/Time/Date Filename/Size  
 
#1 Portale
14:52 Mar 14, 2005
Fl_Text_Edit_ScrollBars.png
8k
 
 
#2 Portale
14:28 Mar 15, 2005
Fl_Text_Display_ScrollbarRepaintBug.patch
1k
 
     

Trouble Report Comments:


Name/Time/Date Text  
 
#1 Portale
14:52 Mar 14, 2005
I am almost sure to have read a similar report by Greg Ercolano, but I can't find it anymore.

The scroll bars in Fl_Text_Editor have two minor layout issues:

1) If a vertical scrollbar appears because of many short lines, also a horizontal scroll bar is added, even if it is not needed.

2) If only a horizontal scrollbar is added because of long lines, the right border effect is not painted, as if there also were a vertical scrollbar.

A screenshot is attached.


Here the testing code:
======================
#include <FL/Fl.H>
#include <FL/Fl_Window.H>
#include <FL/Fl_Text_Editor.H>

int main(int argc, char *argv[])
{
    Fl_Window *window = new Fl_Window (150, 150);
    Fl_Text_Buffer *textBuffer = new Fl_Text_Buffer();
    Fl_Text_Editor *textEditor = new Fl_Text_Editor(10, 10, 130, 130);
    textEditor->buffer(textBuffer);

    window->end();
    window->resizable(textEditor);
    window->show(argc, argv);

    return Fl::run();
}
 
 
#2 Portale
14:27 Mar 15, 2005
This small patch prevents the redraw problem described in point 2). I only pulled up a code line in Fl_Text_Display::draw().


Index: Fl_Text_Display.cxx
===================================================================
--- Fl_Text_Display.cxx (revision 4122)
+++ Fl_Text_Display.cxx (working copy)
@@ -2895,13 +2895,13 @@
     // draw the box()
     int W = w(), H = h();
 
+    draw_box(box(), x(), y(), W, H, color());
+
     if (mHScrollBar->visible())
       W -= scrollbar_width();
     if (mVScrollBar->visible())
       H -= scrollbar_width();
 
-    draw_box(box(), x(), y(), W, H, color());
-
     // left margin
     fl_rectf(text_area.x-LEFT_MARGIN, text_area.y-TOP_MARGIN,
              LEFT_MARGIN, text_area.h+TOP_MARGIN+BOTTOM_MARGIN,
 
 
#3 matt
14:52 Mar 15, 2005
I applied the patch an commited it to SVN. It fixes issue 2.  
 
#4 greg.ercolano
08:22 Mar 18, 2005
> I am almost sure to have read a similar report by Greg Ercolano,
> but I can't find it anymore.

    I'm guessing you're thinking of this one:
    http://www.fltk.org/str.php?L351
 
 
#5 Portale
15:22 Mar 18, 2005
>> I am almost sure to have read a similar report by Greg Ercolano,
>> but I can't find it anymore.
>
>     I'm guessing you're thinking of this one:
>     http://www.fltk.org/str.php?L351


That's funny. That's is like my point "1".
But actually I was thinking of a redraw problem like my point "2" which you pointed out. I even remember some kind of screenshot on your homepage you linked too.

Was it you? May be I make a mistake(?). A déjà-vu?
 
 
#6 mike
19:12 Mar 21, 2005
Fixed in Subversion repository.  
     

Return to Bugs & Features ]

 
 

Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.