You are not logged in.

seoras

Beginner

  • "seoras" started this thread

Posts: 2

Date of registration: May 23rd 2011

  • Send private message

1

Monday, May 23rd 2011, 6:53pm

FleListBox control

So how do I get an equivalent to the VB6 common FileListBox control? I've looked at the references and can't see anythng obvious there.

A1880

Intermediate

  • "A1880" is male

Posts: 500

Date of registration: Jan 1st 2009

Location: Hanover, Germany

Occupation: Software Engineer

Hobbies: Hilbert Curves

  • Send private message

2

Monday, May 23rd 2011, 8:03pm

Add a "CommonDialog" control to your form and use the "ShowOpen()" method.

A small example:

Jabaco Source

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
Public Sub cmdLocateKeystore_Click()
      Dim dlg As CommonDialog 
      
      dlg = CommonDialog1
      
      With dlg
         .DialogTitle = "Keystore File"
         .FileName = Text1.Text 
         .ShowOpen()
         
         If Not .IsCanceled  Then
            Text1.Text = .FileName
            trace "Keystore selected:"
            trace "" & .FileName            
         End If
      End With
End Sub


CommonDialog is not perfect yet, but it should do the job for you.
Use the search facility of this forum to get to know about potential pitfalls.

Greetings

A1880

seoras

Beginner

  • "seoras" started this thread

Posts: 2

Date of registration: May 23rd 2011

  • Send private message

3

Monday, May 23rd 2011, 9:50pm

Thank you, but isn't that the equivalent of VB6's Common Dialog control? Is there no simple filelistbox as easily available from the toolbox in VB6?

A1880

Intermediate

  • "A1880" is male

Posts: 500

Date of registration: Jan 1st 2009

Location: Hanover, Germany

Occupation: Software Engineer

Hobbies: Hilbert Curves

  • Send private message

4

Tuesday, May 24th 2011, 2:07pm

Yes, you are right. The DirListBox and FileListBox still have to be added to the Jabaco framework.

Greetings

A1880

theuserbl

Intermediate

Posts: 436

Date of registration: Dec 20th 2008

  • Send private message

5

Wednesday, May 25th 2011, 2:17am

Yes, you are right. The DirListBox and FileListBox still have to be added to the Jabaco framework.


DirListBox and FileListBox are already added !

FileListBox added July 6, 2010:
http://code.google.com/p/jabacoframework…ileListBox.jsrc
DirListBox added July 23, 2010:
http://code.google.com/p/jabacoframework…DirListBox.jsrc

And at
http://www.jabaco.org/board/p2575-framew…e.html#post2575
I posted a precompiled jar-file of the framework (which includes FileListBox and DirListBox).

This post has been edited 1 times, last edit by "theuserbl" (May 25th 2011, 3:19am)


A1880

Intermediate

  • "A1880" is male

Posts: 500

Date of registration: Jan 1st 2009

Location: Hanover, Germany

Occupation: Software Engineer

Hobbies: Hilbert Curves

  • Send private message

6

Wednesday, May 25th 2011, 9:50am

Thanks for this hint/correction.

How do I include these new controls in my projects?
They don't appear in the list of controls within the IDE.

Is it enough to use a "new FileList()"?

The following does not work:

Jabaco Source

1
2
3
4
5
6
Public Sub Command1_Click()
   Dim d As New FileListBox()
   
   d.Parent.show()
   Debug.Print d.List(1)
End Sub


Is the list of controls automatically derived from the Jabaco.jar?
Is it necessary to edit some configuration files?

Greetings

A1880

This post has been edited 1 times, last edit by "A1880" (May 25th 2011, 5:11pm)


theuserbl

Intermediate

Posts: 436

Date of registration: Dec 20th 2008

  • Send private message

7

Thursday, May 26th 2011, 1:11am

Thanks for this hint/correction.

How do I include these new controls in my projects?
They don't appear in the list of controls within the IDE.


Have a look at the uDirBrowse-example:
http://code.google.com/p/jabacoframework…uDirBrowse.jsrc

DirListBox is a UserControl written by FrancoAA. In this case, it is better to integrate the DirListBrowse code completly as Sourcecode in the own project. Because integrating only the binary code, then in the IDE there is no widget to use.


Quoted

Is it enough to use a "new FileList()"?


FileListBox was implemented by me as Class file. So to use it, it is still a little tricky. Right.


Quoted

The following does not work:

Jabaco Source

1
2
3
4
5
6
Public Sub Command1_Click()
   Dim d As New FileListBox()
   
   d.Parent.show()
   Debug.Print d.List(1)
End Sub


Thats a little bit to short. I am currently on Linux, so I can't test it. But I know, that you have everything to write, what the IDE do otherwise automatical.

For your code it means:

Jabaco Source

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
Public Sub Command1_Click()
   Dim d As New FileListBox()
   d.Top = 5
   d.Left = 5
   d.Height = 150
   d.Width = 200
   d.Visible = True
   d.BorderStyle = fmBorderStyleSingle
   d.CanGetFocus = True
   d.Enabled = True
   d.FixedCellHeight = -1
   d.FixedCellWidth = -1
   d.FontBold = False
   d.FontItalic = False
   d.FontName = Arial
   d.FontSize = 9
   d.MousePointer = vbDefault
   d.Orientation = lstOrientationVertical
   d.Style = vbListBoxStandard
   d.MouseIcon = Nothing
   Me.add(d)   

   d.Parent.show()
   Debug.Print d.List(1)
End Sub



For more examples of integrating new controls in Jabaco hava a look at the examples at
http://www.jabaco.org/board/589-examples…s-and-more.html

For example the LineExample uses a "Line-Control", which not exists in the IDE.

And the JabPic-example uses - if I remember right - a control with vertical text, which not exists as control in the IDE.



Quoted

Is the list of controls automatically derived from the Jabaco.jar?


No, that is the sadly problem. The shown controls in the IDE are completly independent of Jabaco.jar. They exists, too, when Jabaco.jar not exists.
The only controls which are not automatical there are self created UserControls. But they are only there, if the USerControls are in Sourcecode in your project.

Quoted

Is it necessary to edit some configuration files?

No.


Greatings
theuserbl

A1880

Intermediate

  • "A1880" is male

Posts: 500

Date of registration: Jan 1st 2009

Location: Hanover, Germany

Occupation: Software Engineer

Hobbies: Hilbert Curves

  • Send private message

8

Thursday, May 26th 2011, 9:04am

OK. So it is actually possible to use FileListBox and DirListBox.
But faint hearted developers might still consider using CommonDialog until FileListBox and DirListBox get properly integrated in Framework and IDE.

The big value of the examples is that they demonstrate ease and flexibity to create user specific controls and integrate them in Jabaco projects.

Thanks for sharing!

Greetings

A1880

Rate this thread
WoltLab Burning Board