You are not logged in.

theuserbl

Intermediate

  • "theuserbl" started this thread

Posts: 436

Date of registration: Dec 20th 2008

  • Send private message

1

Saturday, November 3rd 2012, 4:43am

Added Anchor() Property

Have added Anchor() Property in the Jabaco Framework:
[ http://code.google.com/p/jabacoframework/source/detail?r=90 ]

A compiled Jabaco.jar you can find again at
[ https://code.google.com/p/jbaindi/downloads/list ]
The direct link:
[ https://jbaindi.googlecode.com/files/Jabaco-rev90.jar ]
Rename Jabaco-rev90.jar to Jabaco.jar and replace the Jabaco.jar-file in your Jabaco-directorty with it.

This is only a temprary state. I will later improve it more.


About Anchor():

The Anchor() Property exists in Visual Basic versions newer then VB6. But this feature is nice, so that I thought to implememnt it.

If you resize your window, all controls are still in the same position of the left top corner.
If you want to have - for example - a CommandButton on the right bottom corner, you have to write

Source code

1
2
3
4
Public Sub Form_Resize()
   Command1.Left = Me.Width - 250
   Command1.Top = Me.Height - 150
End Sub


But if you have a lot of controls, you write a lot of those code.
Isn't it something for the GUI-designer?

As default all controls have still as Anchor "vbTopLeft". But if you want for example the CommandButton on the right bottom corner, you only need to select "vbBottomRight".

And like all properties, you can use it in the code too:

Source code

1
2
3
Public Sub Command2_Click()
   Command1.Anchor = vbBottomRight
End Sub


Greatings
theuserbl

Dani

Intermediate

Posts: 325

Date of registration: Nov 19th 2009

Location: GERMANY

  • Send private message

2

Saturday, November 3rd 2012, 6:42pm

Hey there theuserbl,

verry nice example of how to run through all the VB components/ classes.
After just little testing with a few controlls I must say it makes rezising much easier.
You don't have to worry about the placing of controlls relative to each other.
Nice feature. :thumbsup:

Since I am on an old machine I allways worry about speed and resources.
How do you think this will affect loading of Forms and Dialogs?
Of course I did not notice any difference, still I'd like to know.

Would you mind posting an updated FrameworkTest-rev90 source!?
I would like to be on the same page here...

Maybe for the next version you could fix the ComboBox Bug ->
http://www.jabaco.org/board/p3126-combobox1-listindex-can-not-be-set-to-0-or-1.html#post3126

I would really apreciate that.


Thanks again.


Dani

theuserbl

Intermediate

  • "theuserbl" started this thread

Posts: 436

Date of registration: Dec 20th 2008

  • Send private message

3

Sunday, November 4th 2012, 3:56pm

Since I am on an old machine I allways worry about speed and resources.
I worry about it, too. But since some month I have no longer an old machine. So it is nice to hear (or to read) that you have one and so you can test it on it on a machine with limitit resources.

Quoted

How do you think this will affect loading of Forms and Dialogs?
Of course I did not notice any difference, still I'd like to know.
No difference in the performance? That is nice.
But in the future I want to change some added Anchor-code with reflection. And this could be slow. So I hope that you can then test it, whether it is too slow or not.

Quoted

Would you mind posting an updated FrameworkTest-rev90 source!?
Ok. I have now created a minor Update:
[ http://code.google.com/p/jabacoframework/source/detail?r=91 ]
Only little bugfixes.
The Jar file:
[ http://jbaindi.googlecode.com/files/Jabaco-rev91.jar ]
and the Source file:
[ http://jbaindi.googlecode.com/files/jabaco-rev91-src.zip ]

But you can everytime download the latest one yourself:
1. Download Silk SVN and install it:
[ http://www.sliksvn.com/en/download ]
2. Open a "Command Prompt" (in german "Eingabeaufforderung") by clicking on the Windows-Start-Menu "start -> Programs -> Accessories -> Command Prompt" (in german "Start -> Programme -> Zubehör -> Eingabeaufforderung")
3. Type in this box at first

Source code

1
cd Desktop
then

Source code

1
mkdir jabacosrc
then

Source code

1
cd jabacosrc
and then

Source code

1
svn checkout http://jabacoframework.googlecode.com/svn/trunk/ jabacoframework
4. Now look at your desktop. There is a directory called "jabacosrc". In this dirctory is a directory called "jabacoframework" in which is the complete source.

Quoted

Maybe for the next version you could fix the ComboBox Bug
Is integrated in Revision 91.
Thanks for the bugfix.

Greatings
theuserbl

Dani

Intermediate

Posts: 325

Date of registration: Nov 19th 2009

Location: GERMANY

  • Send private message

4

Monday, November 5th 2012, 10:05am

Hey there theuserbl,

thanks a lot,
especially for the Silk SVN. I wasn't aware of that possibillity.

About the little BugFix - what do you not like about '>=' ...

Jabaco Source

1
2
3
4
5
Public Property Let ListIndex(val As Integer)
   If val >= -1 And val < ListCount Then
      Call Parent.setSelectedIndex(val)
   End If
End Property


I think there are many occasions where you want a ComboBox to be empty.
And with ComboBox1.Parent.setSelectedIndex(-1) it is possible anyway!


Thanks again,




Dani

theuserbl

Intermediate

  • "theuserbl" started this thread

Posts: 436

Date of registration: Dec 20th 2008

  • Send private message

5

Monday, November 5th 2012, 1:44pm

About the little BugFix - what do you not like about '>=' ...
Uuups. Sorry. Haven't seen it.

I have it now added to the svn:
[ http://code.google.com/p/jabacoframework/source/detail?r=92 ]

A compiled binary I will creating somehow later.

Greatings
theuserbl

Dani

Intermediate

Posts: 325

Date of registration: Nov 19th 2009

Location: GERMANY

  • Send private message

theuserbl

Intermediate

  • "theuserbl" started this thread

Posts: 436

Date of registration: Dec 20th 2008

  • Send private message

7

Tuesday, November 6th 2012, 3:49am

Only current update:
[ Jabaco-rev93.jar ]

Dani

Intermediate

Posts: 325

Date of registration: Nov 19th 2009

Location: GERMANY

  • Send private message

8

Wednesday, November 7th 2012, 10:48am

Hey there theuserbl,

I think it would be nice to have this in the framework:

Jabaco Source

1
2
3
4
5
6
7
'->ListBox.jsrc

' ******************************** SPECIAL FUNCTIONS ********************************
Public Sub RemoveItemAt(Index As Integer)
   myModel.removeElementAt(Index)
   Call fireChange()
End Sub


So maybe while you are at it ... for the next release!?


Dani

theuserbl

Intermediate

  • "theuserbl" started this thread

Posts: 436

Date of registration: Dec 20th 2008

  • Send private message

9

Wednesday, November 7th 2012, 3:36pm

I think it would be nice to have this in the framework:
Thanks.
Is uploaded to svn:
[ http://code.google.com/p/jabacoframework/source/detail?r=94 ]

with two small changes:

1. changed "Index" to "v", because I was not sure about the use of "Index". A

Jabaco Source

1
System.out.println(List1.Index)
gives out -1. So it seems to be already defined.

2. changed the name of "RemoveItemAt" to "RemoveItem" (without "At").
If you want, I can change it again to the one with "At".
But VB6 have it without it:

Jabaco Source

1
2
3
4
5
6
7
8
9
10
Private Sub Form_Load()
  List1.AddItem ("First Entry")
  List1.AddItem ("Second Entry")
  List1.AddItem ("Third Entry")
  List1.AddItem ("Fourth Entry")
End Sub

Private Sub Command1_Click()
  List1.RemoveItem (1)
End Sub


On the other side, VB 2008 have an At:

Jabaco Source

1
2
3
4
5
6
7
8
9
10
11
12
Public Class Form1
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        ListBox1.Items.Add("First Entry")
        ListBox1.Items.Add("Second Entry")
        ListBox1.Items.Add("Third Entry")
        ListBox1.Items.Add("Fourth Entry")
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        ListBox1.Items.RemoveAt(1)
    End Sub
End Class

but the "At" exists only, because the one without "At" is for the added objects:

Jabaco Source

1
2
3
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    ListBox1.Items.Remove("Third Entry")
End Sub


Greatings
theuserbl

Dani

Intermediate

Posts: 325

Date of registration: Nov 19th 2009

Location: GERMANY

  • Send private message

10

Thursday, November 8th 2012, 9:33am

Hey there,

looks good to me!
Thanks for taking care of the framework...


Dani

  • "WhatIsSoftware" is male

Posts: 21

Date of registration: Apr 28th 2012

Location: CyberVillage

Hobbies: Web Development. Android Development. Jabaco Development. :)

  • Send private message

11

Tuesday, November 13th 2012, 8:59am

hey userbl.

downloaded updated framework. all seems to be well.

Thanks for removing the 'A' in RemoveItem'. . it was anonying.

regrads
mdos

Dani

Intermediate

Posts: 325

Date of registration: Nov 19th 2009

Location: GERMANY

  • Send private message

12

Thursday, November 15th 2012, 4:04pm

Hey there,

[img]http://www.jabaco.org/board/index.php?page=Attachment&attachmentID=324&h=38c7e8f2151f64a730f02d6a8e1cb256abc12eff[/img]


I suppose that is not intentionally!? ;)


Dani
Dani has attached the following image:
  • AnchorBug.jpg

Dani

Intermediate

Posts: 325

Date of registration: Nov 19th 2009

Location: GERMANY

  • Send private message

13

Thursday, November 15th 2012, 4:08pm

How do I insert an image to a post?
What url is required to not insert the image as an attachment?

Thanks,


Dani

Dani

Intermediate

Posts: 325

Date of registration: Nov 19th 2009

Location: GERMANY

  • Send private message

14

Wednesday, November 21st 2012, 2:54pm

Hey there theuserbl,

I am about to commit some patches to the framework.
Manuel set me up with committer priveleges.

I am a bit unsure about naming conventions though...
The framework itself is sometimes inconsisten about that!

You changed my little patch from

Jabaco Source

1
Public Sub RemoveItemAt(Index As Integer)


to

Jabaco Source

1
Public Sub RemoveItem(v As Integer)


Why not

Jabaco Source

1
(Index As Integer)


since for example in ComboBox.jsrc it also is

Jabaco Source

1
RemoveItem(Index As Integer)


I don't mind naming it 'v' but maybe the user is more guided towards using the ListIndex otherwise

It is a tough decision whether to add a feature or not!?
Should I set up polls?
Should I post the code before committing?
Should I commit and wait for replies?

I guess these questions are not new :S


Dani

theuserbl

Intermediate

  • "theuserbl" started this thread

Posts: 436

Date of registration: Dec 20th 2008

  • Send private message

15

Thursday, November 22nd 2012, 3:57pm

I suppose that is not intentionally!? ;)

True. :-)
Thanks for the info.

I currently haven't the time to fix it.
And I am not sure, if it would be better
to copy all methods (without the Anchor-part) from Label to JBCellData
or
to create a new file called AbstractLabel (similar to AbstarctForm) or BasicLabel, which will be the superclass of Label and JBCellData.

First possibility could be possible, that it needs more code.
Last possibility ends with an additional file, which never will be direct used in Jabaco.

theuserbl

Intermediate

  • "theuserbl" started this thread

Posts: 436

Date of registration: Dec 20th 2008

  • Send private message

16

Thursday, November 22nd 2012, 4:18pm

Why not

Jabaco Source

1
(Index As Integer)
Because I was unsure of side effects, when using Index, which already is internal used.

Quoted

since for example in ComboBox.jsrc it also is

Jabaco Source

1
RemoveItem(Index As Integer)
Ok, then there don't exsiting side-effects.

Quoted

I don't mind naming it 'v' but maybe the user is more guided towards using the ListIndex otherwise
Ok, you can change it to Index, if you want.

Quoted

It is a tough decision whether to add a feature or not!?
Should I set up polls?
Should I post the code before committing?
Should I commit and wait for replies?

I guess these questions are not new :S
If the new features are nice and don't break compatiblity to VB6, why not?
The only disadvantige is, that the size of the framework growing up.

But if you edit a file in Jabaco and save the project as FrameworkTest, be sure that you don't upload FrameworkTest.jba.
There existing a bug or so in Jabaco, that if you load the project FrameworkTest.jba and save it, the saved FrameworkTest.jba don't work again. You can then still loading it in the Jabaco IDE, but you can't start the program.
So FrameworkTest.jba is the only file, better to edit manually in an external editor. All the *.jsrc files you can edit either in an external editor (like notepad.exe) or in the Jabaco IDE.

Greatings
theuserbl

Dani

Intermediate

Posts: 325

Date of registration: Nov 19th 2009

Location: GERMANY

  • Send private message

17

Thursday, November 22nd 2012, 6:14pm

Hey there,

thanks, I will keep that in mind!

mdos

Beginner

  • "mdos" is male

Posts: 21

Date of registration: Apr 28th 2012

Location: CyberVillage

Hobbies: Web Development. Android Development. Jabaco Development. :)

  • Send private message

18

Sunday, November 25th 2012, 7:20pm

Hey, Thanks. I love this feature in .net

Rate this thread
WoltLab Burning Board