[Gambas-user] File Chooser OK event?

Caveat Gambas at ...1950...
Thu Dec 19 11:49:49 CET 2013


Hi Rolf

I put the File Chooser on its own form and handled the events from my 
main form...
You can ignore the FORM_LEFT, FORM_RIGHT stuff... that was just for the 
fact this code comes from a program that opens and compares 2 files... 
so I just needed to keep track of which one was being chosen... but it 
does show how you can pass around extra information should you need to...

Public Sub pbChoose1_Click()

   showChooser(FORM_LEFT)

End

Public Sub pbChoose2_Click()

   showChooser(FORM_RIGHT)

End

Private Sub showChooser(leftright As Integer)

   Dim chooser As FileChooserFrm
   chooser = New FileChooserFrm As "Chooser"
   chooser.setFileNumber(leftRight)
   chooser.setRoot(ROOT)
   chooser.Show

End

Public Sub Chooser_Close()

   Print "Chooser got Close EVENT!"

End

Public Sub Chooser_Done(fileName As String, fileNumber As Integer)

   Print "Chooser got Done EVENT!"
   If fileNumber = FORM_LEFT Then
     txtFile1.Text = fileName
   Else If fileNumber = FORM_RIGHT Then
     txtFile2.Text = fileName
   End If
End

Kind regards,
Caveat

On 19/12/13 11:36, Rolf-Werner Eilert wrote:
> Just saw that File Chooser can have its own OK and Cancel buttons, but
> how would I handle these events? Never used it before, and there is no
> hint in the help...
>
> Regards
> Rolf
>
> ------------------------------------------------------------------------------
> Rapidly troubleshoot problems before they affect your business. Most IT
> organizations don't have a clear picture of how application performance
> affects their revenue. With AppDynamics, you get 100% visibility into your
> Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
> http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk
> _______________________________________________
> 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