FLTK logo

STR #2295

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 2.0 | Post Text | Post File | SVN ⇄ GIT ]

STR #2295

Application:FLTK Library
Status:5 - New
Priority:1 - Request for Enhancement, e.g. asking for a feature
Scope:3 - Applies to all machines and operating systems
Subsystem:Unassigned
Summary:ComboBox
Version:2.0-feature
Created By:szukw000
Assigned To:Unassigned
Fix Version:Unassigned
Update Notification:

Receive EMails Don't Receive EMails

Trouble Report Files:

Post File ]
Name/Time/Date Filename/Size  
 
#1 AlbrechtS
00:57 Dec 02, 2009
combobox_1.diff
1k
 
 
#2 AlbrechtS
00:57 Dec 02, 2009
combobox_2.diff
0k
 
     

Trouble Report Comments:

Post Text ]
Name/Time/Date Text  
 
#1 szukw000
10:31 Dec 01, 2009
Status: RFE (see below)
w. szukalski wrote:
> I can not change the textsize of the Input widget of the ComboBox.
>
>     combo->textsize(18);
>
> changes the textsize of the items only. The Input textsize remains
> to be 12.

verified in my test.

> Is there no method to change the textsize of the Input widget?

Don't know, and it looks like ComboBox isn't documented at all :-(

> In desparation I made the following changes in fltk-2.0.x-r6921.
>
> winfried
>
> --- fltk/ComboBox.h.orig 2009-11-30 15:12:26.000000000 +0100
> +++ fltk/ComboBox.h 2009-11-30 15:12:46.000000000 +0100
> @@ -58,6 +58,7 @@
>
>    int size(bool ofText) const
>  { return ofText ? input_->size() : Choice::size(); }
> +  void input_textsize(int v){ input_->textsize(v); }

This is useless, probably because you added this before the second
part of the patch. It is overridden by the added statements in
src/ComboBox.cxx (see below):

>    int position() const { return input_->position();}
>    int mark() const { return input_->mark();}

The following patch is in ComboBox::draw():

> --- src/ComboBox.cxx.orig 2009-11-30 15:00:31.000000000 +0100
> +++ src/ComboBox.cxx 2009-11-30 16:27:09.000000000 +0100
> @@ -80,6 +80,8 @@
>      fltk::push_matrix();
>      fltk::translate(input_->x(), input_->y());
>      input_->color(color());
> +    input_->textsize(textsize());
This   ^   overwrites any value set by input_textsize().

> +    input_->textcolor(textcolor());
Okay, that was missing as well.

>      input_->draw();
>      fltk::pop_matrix();
>      input_->set_damage(0);

Summary: The patch of src/ComboBox.cxx looks okay for me, the patch of
fltk/ComboBox.h should be omitted.

Would you please add this as an STR for FLTK2 (with RFE status)?

http://www.fltk.org/str.php
 
 
#2 AlbrechtS
01:04 Dec 02, 2009
The STR text doesn't make clear what has been discussed, and what has been the original proposal. I added two files, [1] is the proposed patch, [2] is my recommended patch (only ComboBox.cxx). The complete discussion can be found in [3].

[1] http://www.fltk.org/strfiles/2295/combobox_1.diff
[2] http://www.fltk.org/strfiles/2295/combobox_2.diff
[3] <http://www.fltk.org/newsgroups.php?gfltk.general+Q%22fltk2+and+combobox+and+textsize%22>
 
 
#3 AlbrechtS
01:26 Dec 02, 2009
Note 1: the proposed patch seems to be consistent with what is already implemented. I would probably not have implemented it this way in the first place (some properties of the input widget are copied from the main ComboBox widget in the draw() method). Maybe a redesign with a more complete API could be helpful. Proposal: override the textsize() method (and others) to do something like:

void ComboBox::textsize(float ts) {
  Widget::textsize(ts);
  input_->textsize(ts);
}

Note 2: This widget seems to be similar to FLTK-1's Fl_Input_Choice, which is derived from Fl_Group. I suggest to compare these two widgets when (eventually) merging FLTK-1 and FLTK-2. On the first look I would (maybe) prefer the FLTK 2 widget hierarchy, because it looks cleaner to me. Just an idea...
 
     

Return to Bugs & Features | Post Text | Post File ]

 
 

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'.