[Gambas-user] Custom List Control

Fabien Bodard gambas.fr at ...626...
Fri Jul 31 16:28:46 CEST 2015


I suggest you to download canvas sources, and open gb.gui.base in the comp
directory with the ide.

In this component you will see how listbox, treeview, iconview, and many
more are made using scrollingarea, gridview (in gambas too), and the paint
class.

For your need I suggest you to be based on the gridview like gambas do.
And  use the grid view wordwrap and cells font to manage fonts.
Le 30 juil. 2015 18:56, "Patrick Wright" <patrickfrog at ...626...> a écrit :

> Alright, I have inherited a ScrollArea in my new control and have made
> sure to set is .ScrollBar property to Scroll.Vertical.  However, when I
> call my Add member function which creates a new instance of a TextLabel
> with Me as the parent, it does not cause the scroll bar to appear when the
> items overflow the current view. This is odd because I can replicate the
> same code in a simple form outside of the control and everything works
> correctly.
>
> Do you know why this would be occurring?
>
> Patrick
>
> On Jul 30, 2015, at 7:54 AM, Patrick Wright <patrickfrog at ...626...> wrote:
>
> > I was unaware I was using an outdated version of Gambas. I added the
> repository for the most recent stable release (or so I thought) to Ubuntu.
> I will look into using a GridView of ScrollArea.
> >
> > Thanks,
> > Patrick
> >
> > On Jul 29, 2015, at 2:46 PM, Benoît Minisini <
> gambas at ...1...> wrote:
> >
> >> Le 29/07/2015 21:38, Patrick Wright a écrit :
> >>> Hello,
> >>>
> >>> I am working on a simple, custom control similar to the ListBox using a
> >>> ListContainer and TextLabels.  I am using these two items because the
> >>> default ListBox control (and every other list) don't seem to support
> text
> >>> wrapping or fonts.
> >>>
> >>> Everything seems to be going well, however I am unable to find a
> method to
> >>> make the ListContainer scroll to a speici item in code.  When i add a
> new
> >>> item, I would like it to be scrolled to so it is visible. Normally,
> this
> >>> would be accomplished with the .Index property in the ListBox, but this
> >>> does not have the same affect in a ListContainer.
> >>>
> >>> Any ideas on how I could get this to work?
> >>>
> >>> Gambas Version: 3.5.4
> >>>
> >>> Thanks,
> >>> Patrick
> >>
> >> ListContainer has been deprecated since, mainly because of such limits.
> I suggest that you remake your control based a GridView or a ScrollArea.
> >>
> >> Can't you use a more recent version of Gambas anyway?
> >>
> >> Regards,
> >>
> >> --
> >> Benoît Minisini
> >>
> >>
> >
> >
>
>
> ------------------------------------------------------------------------------
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>



More information about the User mailing list