You are not logged in.

Dear visitor, welcome to Jabaco - Community. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

Dani

Intermediate

  • "Dani" started this thread

Posts: 325

Date of registration: Nov 19th 2009

Location: GERMANY

  • Send private message

1

Monday, October 14th 2013, 10:04am

ComboBox/ListBox - Update

Hey there,

since I was at it and it was only a couple lines of code, I added .BackColorAlternating to the ComboBox and ListBox



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
26
27
Public Sub Form_Load()
   ComboBox1.BackColorAlternating = RGB(240, 240, 240)
   ComboBox1.ListData(0) = "ListDataArray(0)"
   ComboBox1.AddItem "Test1"
   ComboBox1.AddItem "Test2"
   ComboBox1.AddItem New ListCellData("Test3", resources.RssPng, False)
   ComboBox1.AddItem "Test4"
   ComboBox1.AddItem "Test5"
   
   List1.BackColorAlternating = RGB(240, 240, 240)
   List1.ListData(0) = "ListDataArray(0)"
   List1.AddItem "Test1"
   List1.AddItem "Test2"
   List1.AddItem New ListCellData("Test3", Nothing, True)
   List1.AddItem New ListCellData("Test4", resources.RssPng, False)
   List1.AddItem "Test5"
   List1.Style = vbListBoxCheckbox  
   Dim i As Integer
   For i = 6 To 10
      ComboBox1.AddItem("Test" & i )
      List1.AddItem("Test" & i )
   Next i 
End Sub

Public Sub List1_Click()
   Debug.Print List1.ListData(0)
End Sub



@ theuserbl: sorry, I was bored this weekend. I hope you will find the time to compile the framework again ... thanks :thumbsup:


Dani

This post has been edited 1 times, last edit by "Dani" (Oct 14th 2013, 2:33pm)


Dani

Intermediate

  • "Dani" started this thread

Posts: 325

Date of registration: Nov 19th 2009

Location: GERMANY

  • Send private message

2

Monday, October 14th 2013, 10:10am

these would be the according sections for the Jabaco.xml to set the default values at startup:

Source code

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
26
27
28
29
30
31
		<Object Type="List">
			<Param Name="BorderStyle" Value="fmBorderStyleSingle"/>
			<Param Name="CanGetFocus" Value="True"/>
			<Param Name="BackColor" Value="-2147483643"/>
			<Param Name="BackColorAlternating" Value="-2147483643"/>
			<Param Name="ForeColor" Value="-2147483640"/>
			<Param Name="BackColorSel" Value="-2147483635"/>
			<Param Name="ForeColorSel" Value="-2147483634"/>
			<Param Name="BorderColorSel" Value="-2147483638"/>
			<Param Name="FontName" Value="Arial"/>
			<Param Name="FontSize" Value="9"/>
			<Param Name="Visible" Value="True"/>
			<Param Name="FixedCellHeight" Value="-1"/>
			<Param Name="FixedCellWidth" Value="-1"/>
			<Param Name="ListIndex" Value="0"/>
			<Param Name="Margin" Value="0"/>
			<Param Name="MarginItem" Value="1"/>
		</Object>
		<Object Type="ComboBox">
			<Param Name="CanGetFocus" Value="True"/>
			<Param Name="BackColor" Value="-2147483643"/>
			<Param Name="BackColorAlternating" Value="-2147483643"/>
			<Param Name="ForeColor" Value="-2147483640"/>
			<Param Name="BackColorSel" Value="-2147483635"/>
			<Param Name="ForeColorSel" Value="-2147483634"/>
			<Param Name="BorderColorSel" Value="-2147483638"/>
			<Param Name="FontName" Value="Arial"/>
			<Param Name="FontSize" Value="9"/>
			<Param Name="Visible" Value="True"/>
			<Param Name="MarginItem" Value="1"/>
		</Object>

Dani

Intermediate

  • "Dani" started this thread

Posts: 325

Date of registration: Nov 19th 2009

Location: GERMANY

  • Send private message

3

Monday, October 14th 2013, 10:21am

@ theuserbl
Suggestion: Why don't you start a single thread under History & News where you can allways post the latest framework .jar !?
That way everybody can save a link to that post and easily find updates.

What do think?


Dani

theuserbl

Intermediate

Posts: 436

Date of registration: Dec 20th 2008

  • Send private message

4

Monday, October 14th 2013, 3:34pm

Ok, uploaded at
[ JabacoFramework-rev116.zip ]

To all: It is now needed to unzip this zip file in your Jabaco-directory.
Beside a new Jabaco.jar it includes a new Jabaco.xml and all language-files in the SVN.


If you are using Windows 7 or Windows 8, then have additional a look, if the directory
C:\Users\[Your WinAccountName]\AppData\Local\VirtualStore\Program Files (x86)\Jabaco
exists and if there is a file called Jabaco.xml included.
If it is so, then overwrite it with the XML-file in the zip-package, too.

Warning: If you oberwrite your XML-files the list of your last opend files is lost!
But I think, this list is not so important. You can see the list, if you click on "New project" and on the dialog window then on the "Recent"-tab.
After overriting the XML-file, this list is empty, like after a new install of Jabaco.


@ theuserbl
Suggestion: Why don't you start a single thread under History & News where you can allways post the latest framework .jar !?
It is no longer possible to write in this section. Try it out. Manuel have disabled it.
You can neither create a new thread there, nor you can answer to an existing one there.

Greatings
theuserbl

Dani

Intermediate

  • "Dani" started this thread

Posts: 325

Date of registration: Nov 19th 2009

Location: GERMANY

  • Send private message

5

Monday, October 14th 2013, 3:56pm

Thanks a lot theuserbl !

Quoted

It is no longer possible to write in this section.


Oh, OK I didn't know abaout that...

Anyway, I will start a thread somewhere else and allways add new versions to it.
I will take your links if you don't mind.
That way we will have every release in one place and people can refer to this thread.

By the way, we got lucky Jabaco.org is still up...

Dani

theuserbl

Intermediate

Posts: 436

Date of registration: Dec 20th 2008

  • Send private message

6

Monday, October 14th 2013, 4:12pm

Anyway, I will start a thread somewhere else and allways add new versions to it.
I will take your links if you don't mind.
That way we will have every release in one place and people can refer to this thread.


Possible we could add those links to the wiki:
http://www.jabaco.org/wiki/Main_Page
(Login-name and Password is the same like for this forum).

After your changes, this sides could be extended with the new features:
http://www.jabaco.org/wiki/JBGrid
http://www.jabaco.org/wiki/ListBox
http://www.jabaco.org/wiki/ComboBox

Greatings
theuserbl

Dani

Intermediate

  • "Dani" started this thread

Posts: 325

Date of registration: Nov 19th 2009

Location: GERMANY

  • Send private message

7

Monday, October 14th 2013, 4:27pm

Quoted

Possible we could add those links to the wiki:
http://www.jabaco.org/wiki/Main_Page
(Login-name and Password is the same like for this forum).


Aha, I didn't even know we could edit anything there!

Hm, would Manuel let us post links to Jabaco.jars there?
In the forum it is up to us. But in the Wiki he might feel that he has to vouch for what we are doing with the framework.

Also I believe those links are easier to be found over here.
I don't know?? ?(

But I might actually write to the Wiki ...


Dani

Dani

Intermediate

  • "Dani" started this thread

Posts: 325

Date of registration: Nov 19th 2009

Location: GERMANY

  • Send private message

8

Tuesday, October 15th 2013, 10:57am

I found a little bug:

The JBGrid ComboList BackColor is messed up since ComboBox has its own BackColorAlternating Value now! :cursing:
I will upload a patch to the framework soon.
Sorry about that...

Just let me make sure everything else works fine for now!!

Thanks,

Dani

PS: You might want to stay with rev. 115

theuserbl

Intermediate

Posts: 436

Date of registration: Dec 20th 2008

  • Send private message

9

Tuesday, October 15th 2013, 2:35pm

I found a little bug:

The JBGrid ComboList BackColor is messed up since ComboBox has its own BackColorAlternating Value now!

Fixed:
[ JabacoFramework-rev117.zip ]

Greatings
theuserbl

Dani

Intermediate

  • "Dani" started this thread

Posts: 325

Date of registration: Nov 19th 2009

Location: GERMANY

  • Send private message

10

Tuesday, October 15th 2013, 3:37pm

Hey there theuserbl,

thanks and sorry, I had to change it little more.
Essentially it is the same as your fix ;)

something else:
do you know why in the ListBox code we have

Jabaco Source

1
2
3
4
5
6
7
8
9
10
11
Public Property Get BackColor() As Long
   BackColor = ColortoRGB(Parent.getBackground())
   Call Base.setBackground(Parent.getBackground())   
End Property

'and...

Public Property Let ForeColor(v As Long)
    Parent.setForeground(RGBtoColor(v))
    Call Base.setForeground(Parent.getForeground())
End Property


we should be fine with

Jabaco Source

1
2
3
4
5
6
7
8
9
Public Property Get BackColor() As Long
   BackColor = ColortoRGB(Parent.getBackground())
End Property

...

Public Property Let ForeColor(v As Long)
    Parent.setForeground(RGBtoColor(v))
End Property


I looked at all previous revisions and it has been there from the first on!
I can't see why though.
I guess it is some leftover.


Dani

theuserbl

Intermediate

Posts: 436

Date of registration: Dec 20th 2008

  • Send private message

11

Tuesday, October 15th 2013, 4:32pm

do you know why in the ListBox code we have

Jabaco Source

1
2
3
4
Public Property Get BackColor() As Long
   BackColor = ColortoRGB(Parent.getBackground())
   Call Base.setBackground(Parent.getBackground())   
End Property

Interesting :|


Quoted

we should be fine with

Jabaco Source

1
2
3
Public Property Get BackColor() As Long
   BackColor = ColortoRGB(Parent.getBackground())
End Property


The other way around.
Call Base.setBackground(Parent.getBackground())
is compiled the same, like if you write
Me.setBackground(Me.Parent.getBackground())

That sets the background color.

But
BackColor = ColortoRGB(Parent.getBackground())
in the property
Public Property Get BackColor() As Long
seems, that it should run the Set property.
But it don't do so.

I thought, it would compiled to Java to
Me.$BackColor (VBA.Information.ColortoRGB(Me.$Parent.getBackground()));
But it compiles to
$BackColor = VBA.Information.ColorToRGB(Me.$Parent().getBackground());

And that makes no sense, because the variable/field $BackColor dont exists. There exists only the methods $BackColor() and $BackColor(long).

So for the current Jabaco-compiler, the first line of the two propertys makes no sense, if I see it right.

Greatings
theuserbl

theuserbl

Intermediate

Posts: 436

Date of registration: Dec 20th 2008

  • Send private message

12

Tuesday, October 15th 2013, 5:34pm

Hi Dani!

Do you have seen, that now FileListBox don't work correct?

If you start FrameworkTest, on the Tab "DirBrowse", the right Listbox.
The problem: FileListBox have ListBox as superclass. And for FileListBox existing no entry in the XML-file.

So, I think about it, to change in write in ListBox

Jabaco Source

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
Public Sub Class_Initialize()
   On Error Resume Next
   myBackColorAlternating = Me.BackColor   ' <=== this is the new line
   Call Parent.addFocusListener(Me)
   Call Parent.addMouseListener(Me)
   Call Parent.addMouseMotionListener(Me)
   Call Parent.addKeyListener(Me)
   Call Parent.addListSelectionListener(Me)
   Call Parent.setCellRenderer(myRenderer)
   Call Me.setViewportView(myList)
   
   myDefaultBorder = Base.getBorder()
   Call Base.setOpaque(False)
   
End Sub


Then all works ok.
Possibly the same could be done with CheckBox and JBGrid.
Additional advantage: Then the XML-file don't need to change.

Greatings
theuserbl

theuserbl

Intermediate

Posts: 436

Date of registration: Dec 20th 2008

  • Send private message

13

Tuesday, October 15th 2013, 5:46pm

Ok, the XML file-changes are still needed. But the problem with FileListBox would be with this change fixed.

Dani

Intermediate

  • "Dani" started this thread

Posts: 325

Date of registration: Nov 19th 2009

Location: GERMANY

  • Send private message

14

Tuesday, October 15th 2013, 5:54pm

Hey there,

Jabaco Source

1
2
3
4
5
6
7
8
9
Public Property Get BackColor() As Long
   BackColor = ColortoRGB(Parent.getBackground())
End Property

...

Public Property Let ForeColor(v As Long)
    Parent.setForeground(RGBtoColor(v))
End Property


these two are fine, they return / set what they are supposed to.
BackColor is the return of Property BackColor (), no variable needed and that's how it is done in most of the Jabaco controls!

I was just wondering about the additional lines starting with " Call...". They are not necessary.

Quoted

Do you have seen, that now FileListBox don't work correct?


I was afraid my changes would have some unforeseen sideefects.
Let me look into it...


Dani

Dani

Intermediate

  • "Dani" started this thread

Posts: 325

Date of registration: Nov 19th 2009

Location: GERMANY

  • Send private message

15

Tuesday, October 15th 2013, 6:12pm

I would rather change FileListBox:

Jabaco Source

1
2
3
4
5
Public Sub Class_Initialize()
  myDirectory = CurDir
  Base.BackColorAlternating = Base.BackColor   ' <=== this is the new line
  Update_Filename_List()
End Sub


We could add Property BackColorAlternating to FileListBox too!?

Quoted

Possibly the same could be done with CheckBox and JBGrid.


Does the CheckBox in the VBGrid not work right?
It does for me!!


Dani

Dani

Intermediate

  • "Dani" started this thread

Posts: 325

Date of registration: Nov 19th 2009

Location: GERMANY

  • Send private message

16

Tuesday, October 15th 2013, 6:23pm

The xml changes are needed!

Because from my point of view this is rather a Jabaco IDE Problem than an framework issue.
There are only a few hardcoded values in the framework except for constants or some special cases not too important for the Jabaco user.

It probably is a question of design!

We should keep them in one place and in the xml file they are easier to accessand most values are stored there anyway.
You where right in uploading a new Jabaco.xml. I think when we introduce new Properties we need to upload a new Jabaco.xml file.


Dani

theuserbl

Intermediate

Posts: 436

Date of registration: Dec 20th 2008

  • Send private message

17

Tuesday, October 15th 2013, 7:48pm

I already thought about it before, but thought it would be a bad solution, because of complexness. But now I think it would be good:

All three classes (ComboBox, ListBox and JBGrid) needing a additional property. :D

For example for JBGrid:

A new property called ""BackColorCellsPattern".
The argument for it is then an enum with
- vbNone
- vbHorizontal
- vbVertical
- vbChessboard

As default is vbNone. Then the color of BackColorCellsAlternating is unimportant, if
BackColorCellsPattern = vbNone

Greatings
theuserbl

Dani

Intermediate

  • "Dani" started this thread

Posts: 325

Date of registration: Nov 19th 2009

Location: GERMANY

  • Send private message

18

Tuesday, October 15th 2013, 8:02pm

Yeah, I know I thought of that too!
And maybe also a RowHeader and a HeaderMatrix.

While I was implementing the BackColorAlternating I found that everything coul be done within each Renderer but I decided to stick with what Manuel provided. So I just extended wich sometimes tends to bloat a bit!!

But as you said, it is quite some work to start from scratch.
I believe the solution right now is quick and clean enough. The renderer calls some properties but that's fine.
Except for the xml part it should be allright now.

So, what about the CheckBox and FileListBox?


Dani

theuserbl

Intermediate

Posts: 436

Date of registration: Dec 20th 2008

  • Send private message

19

Tuesday, October 15th 2013, 8:24pm

So, what about the CheckBox and FileListBox?
I only know, that the current FileListBox is not ok. But I think you can't change it with the xml-file, because the FileListBox is not integrated in the current Jabaco-GUI-Designer. Have you seen, the black lines there?

But a
myBackColorAlternating = Me.BackColor
in
Class_Initialize()
of the ListBox class would fix it.
But I am not sure, if there existing other side-effects.

Possible, the CheclkBox needs something similar. Currently existing no control, which have the CheckBox as superclass.

Greatings
theuserbl

Dani

Intermediate

  • "Dani" started this thread

Posts: 325

Date of registration: Nov 19th 2009

Location: GERMANY

  • Send private message

20

Tuesday, October 15th 2013, 8:29pm

Hm, did you read my post further up
http://www.jabaco.org/board/p3786-combob…e.html#post3786

I don't see a problem with the CheckBox or do you mean the ComboBox?

I did add 'BackColorAlternating' there but I tested many usecases!

If you do modify FileListBox please don't forget

Jabaco Source

1
2
3
Option Explicit
'and
Dim i as Integer


within the code ;)


Dani

Rate this thread
WoltLab Burning Board