[Gambas-user] Chronic columnview Woes

Richard Terry rterry at ...1823...
Fri May 31 12:02:10 CEST 2013


Fabien Bodard wrote:
> What is the good size ?
>
> Do you want to have an autoresize horizontal ?
>
> Vertical ?
>
> with word wrap ?
>   
just to do what a columnview should do ie the columnview's column sizes 
fit the contents  so they can be read
This works sort-of-erratically and used to work properly, no idea why. 
i.e horizontal column widths I mean

Word wrap no

richard

>
>
>
> 2013/5/31 richard terry <rterry at ...1823...>
>
>   
>> Another columnview question if possible
>>
>> The columnviews used to resize their columns to match the contents, they
>> don't seem to do so any longer. I've tried setting every property there
>> is, and in the end have had to write a sub to manually adjust the
>> columns to a reasonable size.
>>
>> For what should be very simple, could anyone think what I could be doing
>> wrong, or give me a simple example of loading a columnview with data
>> which does resize automatically?
>>
>>
>> Regards
>>
>> richard
>>
>>
>> On 16/05/13 07:59, Fabien Bodard wrote:
>>     
>>> In fact I think I need a better explanation or an example...
>>> What do you really want ?
>>>
>>> To generate a kind of elementclick event?
>>>
>>> Normally you just have to do.:
>>> $sKey = cvw.Item.Key
>>> In the cvw_Click event
>>> And then use the value of $sKey in the cvw_menu event
>>>
>>> Or maybe I have missed something and so tell us more
>>>
>>> Best regards,
>>> Fabien Bodard
>>>   Le 15 mai 2013 08:44, "Richard Terry" <rterry at ...1823...> a
>>>       
>> écrit :
>>     
>>>> Fabien Bodard wrote:
>>>>         
>>>>> Use a flag!!!
>>>>> Le 15 mai 2013 03:46, "Richard Terry" <rterry at ...1823...> a
>>>>>           
>> écrit
>>     
>>>> :
>>>> Sorry Fabien, don't mean to be a pest but if this was a simple problem
>>>> I've figure it myself. I don't understand why this code works
>>>>         
>> erratically.
>>     
>>>> Could you explain what you mean by use a flag with a couple of lines of
>>>> sample code.
>>>>
>>>> Regards
>>>>
>>>> richard
>>>>
>>>>         
>>>>>> Benoît Minisini wrote:
>>>>>>
>>>>>>             
>>>>>>> Le 08/05/2013 02:03, Richard Terry a écrit :
>>>>>>>
>>>>>>>
>>>>>>>               
>>>>>>>> Hi List,
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>                 
>>>>>>>   > ...
>>>>>>>   >
>>>>>>>
>>>>>>>
>>>>>>>               
>>>>>>>> However, lets say I want to popup a menu of the letters collection:
>>>>>>>>
>>>>>>>> If I right mouse click on the list to bring up the menu the
>>>>>>>> cvwLetters_Menu event triggers, but if one inspects the cvwLetters
>>>>>>>> control itself in the IDE, the cvwLetters.item.key is null, however
>>>>>>>>                 
>>>> the
>>>>         
>>>>>>>> cvwletters.selected[0] does contain the value one would expect to be
>>>>>>>>                 
>>>> in
>>>>         
>>>>>>>> the cvwLetters.item.key.
>>>>>>>>
>>>>>>>> I've tried doing e.g cvwLetters.movecurrent() before popping up the
>>>>>>>> menu, this does not seem to make much difference.
>>>>>>>>
>>>>>>>>
>>>>>>>>                 
>>>>>>> The Menu event is not an event managed by the ColumnView control, but
>>>>>>>               
>>>> by
>>>>         
>>>>>>> its Control parent class. This is the reason why the Item property is
>>>>>>> not set during the Menu event handler. The Menu event is raised even
>>>>>>>               
>> if
>>     
>>>>>>> you don't click on an item.
>>>>>>>
>>>>>>> Normally, the Click event will be raised before the Menu event, and
>>>>>>>               
>> so
>>     
>>>>>>> you can store the key of the ColumnView.Item property during the
>>>>>>>               
>> Click
>>     
>>>>>>> event handler (which is a ColumnView event) to use it later during
>>>>>>>               
>> the
>>     
>>>>>>> Menu event handler.
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>               
>>>>>>>> Also I've a chronic problem trying to generate a columnview click
>>>>>>>>                 
>>>> event
>>>>         
>>>>>>>> in code, with a similar outcome to the above - the item.key is not
>>>>>>>>                 
>> set
>>     
>>>>>>>>                 
>>>>>>> The Item property *is* set during a Click event handler. What are you
>>>>>>> talking about with "generate a columnview click event"?
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>               
>>>>>> What I meant was this. Lets say you have loaded the columnview with
>>>>>> data. Now, if the user was sitting in front of the program and wanted
>>>>>>             
>> to
>>     
>>>>>> select an item in the columnview, then he would click on the column
>>>>>> which one would then trap the event and do something with it.
>>>>>>
>>>>>> I often need to be able to emulate that in code, ie have the program
>>>>>>             
>> do
>>     
>>>>>> the same thing. Doing this
>>>>>>
>>>>>> columnview1.Movefirst()
>>>>>> columnview1.item.selected = True
>>>>>>
>>>>>> will sometimes work ie this triggeres the columnview1_Select() routine
>>>>>> and any code associated with this.
>>>>>>
>>>>>> Hope this is clearer.
>>>>>>
>>>>>> Regards
>>>>>>
>>>>>> Richard
>>>>>>
>>>>>> Richard
>>>>>>
>>>>>>
>>>>>>
>>>>>>             
>> ------------------------------------------------------------------------------
>>     
>>>>>> AlienVault Unified Security Management (USM) platform delivers
>>>>>>             
>> complete
>>     
>>>>>> security visibility with the essential security capabilities. Easily
>>>>>>             
>> and
>>     
>>>>>> efficiently configure, manage, and operate all of your security
>>>>>>             
>> controls
>>     
>>>>>> from a single console and one unified framework. Download a free
>>>>>>             
>> trial.
>>     
>>>>>> http://p.sf.net/sfu/alienvault_d2d
>>>>>> _______________________________________________
>>>>>> Gambas-user mailing list
>>>>>> Gambas-user at lists.sourceforge.net
>>>>>> https://lists.sourceforge.net/lists/listinfo/gambas-user
>>>>>>
>>>>>>
>>>>>>             
>> ------------------------------------------------------------------------------
>>     
>>>>> AlienVault Unified Security Management (USM) platform delivers complete
>>>>> security visibility with the essential security capabilities. Easily
>>>>>           
>> and
>>     
>>>>> efficiently configure, manage, and operate all of your security
>>>>>           
>> controls
>>     
>>>>> from a single console and one unified framework. Download a free trial.
>>>>> http://p.sf.net/sfu/alienvault_d2d
>>>>> _______________________________________________
>>>>> Gambas-user mailing list
>>>>> Gambas-user at lists.sourceforge.net
>>>>> https://lists.sourceforge.net/lists/listinfo/gambas-user
>>>>>
>>>>>
>>>>>           
>>>>         
>> ------------------------------------------------------------------------------
>>     
>>>> AlienVault Unified Security Management (USM) platform delivers complete
>>>> security visibility with the essential security capabilities. Easily and
>>>> efficiently configure, manage, and operate all of your security controls
>>>> from a single console and one unified framework. Download a free trial.
>>>> http://p.sf.net/sfu/alienvault_d2d
>>>> _______________________________________________
>>>> Gambas-user mailing list
>>>> Gambas-user at lists.sourceforge.net
>>>> https://lists.sourceforge.net/lists/listinfo/gambas-user
>>>>
>>>>         
>> ------------------------------------------------------------------------------
>>     
>>> AlienVault Unified Security Management (USM) platform delivers complete
>>> security visibility with the essential security capabilities. Easily and
>>> efficiently configure, manage, and operate all of your security controls
>>> from a single console and one unified framework. Download a free trial.
>>> http://p.sf.net/sfu/alienvault_d2d
>>> _______________________________________________
>>> Gambas-user mailing list
>>> Gambas-user at lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/gambas-user
>>>       
>>
>> ------------------------------------------------------------------------------
>> Introducing AppDynamics Lite, a free troubleshooting tool for Java/.NET
>> Get 100% visibility into your production application - at no cost.
>> Code-level diagnostics for performance bottlenecks with <2% overhead
>> Download for free and get started troubleshooting in minutes.
>> http://p.sf.net/sfu/appdyn_d2d_ap1
>> _______________________________________________
>> 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