[Gambas-devel] failed to implement

Fabien Bodard gambas.fr at ...176...
Fri Sep 22 23:54:13 CEST 2006


Le Vendredi 22 Septembre 2006 00:28, Charlie Reinl a écrit :
> Salut,
>
> on gambas2-1.9.42 IDE
>
> I wanted to have at gambas-Wellcome, the possibillity to erase some old
> entrys from the Recent-List.
>
> I made a menu, which opens at a right mouse-click.
>
> PUBLIC SUB btnOpenRecent_Click()
>   $sPath = LAST.Tag
>   IF Mouse.Left THEN
>     ME.Close
>   ELSE
>      mnuRecent.Popup
>   ENDIF
> END
>
> If i click on the menu.
>
> PUBLIC SUB mnuRecentDel_Click()
> DIM hButton AS CCoolButton
> DIM iElem AS Integer
> DIM iInd AS Integer
>
>  iElem = aList.Find($sPath)
>  IF iElem > -1 THEN
>   Project.Recent.Remove(iElem)
>   aList = Project.Recent
>   FOR iInd = 0 TO aList.Count - 1
>     hButton = NEW CCoolButton(svwRecent, 0, iInd * 32, 1024, 32,
> File.Name(aList[iInd]), Project.GetIcon(aList[iInd], 24)) AS
> "btnOpenRecent" hButton.Tag = aList[iInd]
>     hButton.ToolTip = File.Dir(aList[iInd])
>   NEXT
>   IF aList.Count = 0 THEN btnRecent.Enabled = FALSE
>   svwRecent.Refresh
>  ENDIF
> END
>
>
> But I failed, the ScrollView isn't with me.
>
> I'm able to delete the Project.Recent element.
> I remade the aList, which I set Private to the form.
>
> Is there a way to delete an item from the ScrollView ?
yes and no :)

in fact the problem come from CCoolButton witch are an old fashion class.
the scrollview have not ccoolbutton in his children collection but panels...

and then the hbutton var in FWelcome is not a true Control object so not easy 
to destroy.

I've made a new CCoolButton class based on UserControl class. your can try 
with it. 

with that you can do

Cbtn_Click()
mnuDel.Tag= Last
mnuDel.popup

end

mnuDel_Click
CurrentCbtn.Delete
mnuDel.tag = null
end

>
> Would be nice !
>
> Amicalment
> Charlie
>
> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share
> your opinions on IT & business topics through brief surveys -- and earn
> cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> _______________________________________________
> Gambas-devel mailing list
> Gambas-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-devel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: CCoolButton2.class
Type: application/x-java
Size: 2406 bytes
Desc: not available
URL: <http://lists.gambas-basic.org/pipermail/devel/attachments/20060922/2688b5f2/attachment.bin>


More information about the Devel mailing list