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.

Perry

Beginner

  • "Perry" is male
  • "Perry" started this thread

Posts: 40

Date of registration: Jan 15th 2011

Location: Sarasota, FL

Occupation: Cabinet Design

Hobbies: Programming

  • Send private message

1

Wednesday, July 17th 2013, 8:41pm

JbGrid Issues

For the JB Grid Control:
Nice but for a few bugs.
when you set the property Editable = jbEditOn DblClick, a double click on the grid will fire the double click event on all initially visible cells.
However when you need to edit a cell that needs to be scrolled onto the screen, when you double click it, though you can edit the cell, it will not fire the double click event.

I don't know quite how to fix this without kludging a work-around.
Any Ideas?

Dani

Intermediate

Posts: 325

Date of registration: Nov 19th 2009

Location: GERMANY

  • Send private message

2

Wednesday, July 17th 2013, 9:44pm

Hey there,

I think you are not using the latest Jabaco-rev105.jar
I fixed this issue awhile ago :)

You can download the latest Framework .jar file here:
https://code.google.com/p/jbaindi/downloads/list

it is provided by theuserbl!

Just rename it to Jabaco.jar and replace the existing Jabaco.jar in your Jabaco installation path.
If you want to read more about compiling your own read here:
http://www.jabaco.org/board/p3440-how-to…k.html#post3440

for testing use this code:

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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
Option Explicit

Public Sub Form_Load()
   GridTest()
End Sub

Public Sub GridTest()
'JBGrid1.Header = False
   JBGrid1.Cols = 4
   JBGrid1.Rows = 40
   JBGrid1.Editable = jbEditOnDblClick
   JBGrid1.Parent.getTableHeader.setCursor(VBMousePointerToJCursor(vbHandCursor))
   JBGrid1.ColHeaderIndex = 2
   Dim x As Integer, y As Integer
   For y = 0 To JBGrid1.Cols
      JBGrid1.Header(y) = "Header" & y 
      For x = 0 To JBGrid1.Rows
         JBGrid1.DataMatrix(x, y) = "D_Item_" & x & "/" & y
         JBGrid1.DataMatrix(x, y).TextAlign = fmTextAlignRight
      Next
   Next
End Sub

Public Sub JBGrid1_BeforeCellEdit(row As Integer, col As Integer)
   Select Case col
      Case 0  
         JBGrid1.ComboList = "..."           'invokes CellButton
      Case 1 
         JBGrid1.ComboList = "Test1|Test2"   'invokes ComboList, use '|' as item seperator
      Case Else
         JBGrid1.ComboList = ""              'reset to DefaultEditor
   End Select
End Sub

Public Sub JBGrid1_CellButtonClick()
   Me.Caption = "HitTest: CellButtonClick " & JBGrid1.Row & "/" & JBGrid1.Col
End Sub

Public Sub JBGrid1_AfterCellEdit(row As Integer, col As Integer)
   Me.Caption = "HitTest: AfterCellEdit " & row & "/" & col
End Sub

Public Sub JBGrid1_Click()
   Me.Caption = "HitTest: Click " & JBGrid1.Row & "/" & JBGrid1.Col 
End Sub

Public Sub JBGrid1_DblClick()
   Me.Caption = "HitTest: DblClick " & JBGrid1.Row & "/" & JBGrid1.Col 
End Sub

Public Sub JBGrid1_ColHeaderClick()
   Me.Caption = "HitTest: ColHeaderClick " & JBGrid1.ColHeaderIndex
End Sub


works fine with Jabaco-rev105.jar


Dani

Dani

Intermediate

Posts: 325

Date of registration: Nov 19th 2009

Location: GERMANY

  • Send private message

3

Wednesday, July 17th 2013, 9:45pm

Oh, and be sure to backup your existing Jabaco.jar!!!!!!! :D

Perry

Beginner

  • "Perry" is male
  • "Perry" started this thread

Posts: 40

Date of registration: Jan 15th 2011

Location: Sarasota, FL

Occupation: Cabinet Design

Hobbies: Programming

  • Send private message

4

Thursday, July 18th 2013, 6:56pm

I installed Jabaco-rev105.jar.
It took care of that problem. But it introduced another bug

Dim Ret as single
Ret = Int(5/7)

returns a result of 1. not 0 like it should.

Dim Ret as Integer
Ret = 5/7

Gives a better result

Perry

This post has been edited 1 times, last edit by "Perry" (Jul 18th 2013, 7:03pm)


Dani

Intermediate

Posts: 325

Date of registration: Nov 19th 2009

Location: GERMANY

  • Send private message

5

Thursday, July 18th 2013, 9:40pm

Hey there,

you are right Jabaco returns different values:

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
28
29
Dim Ret As Single
   Ret = Int(5 / 7)
   Debug.Print Ret  ' JB 1.0 VB 0
   
   Ret = Fix(5 / 7)
   Debug.Print Ret  ' JB 0.0 VB 0 
    
   Dim Ret1 As Integer
   Ret1 = 5 / 7
   Debug.Print Ret1  ' JB 0 VB 1

   Dim MyNumber As Integer
   MyNumber = Int(99.8)   ' JB 100 VB  99
   Debug.Print MyNumber

   MyNumber = Fix(99.8)   ' JB 99 VB  99
   Debug.Print MyNumber

   MyNumber = Int(-99.8)  ' JB -100 VB  -100
   Debug.Print MyNumber

   MyNumber = Fix(-99.8)  ' JB -99 VB  -99
   Debug.Print MyNumber

   MyNumber = Int(-99.2)  ' JB -99 VB  -100
   Debug.Print MyNumber

   MyNumber = Fix(-99.2)  ' JB -99 VB  -99
   Debug.Print MyNumber


You can look at the underlying java function here:
https://code.google.com/p/jabacoframewor…ersion.java#131

Dani

Perry

Beginner

  • "Perry" is male
  • "Perry" started this thread

Posts: 40

Date of registration: Jan 15th 2011

Location: Sarasota, FL

Occupation: Cabinet Design

Hobbies: Programming

  • Send private message

6

Friday, July 19th 2013, 12:58pm

It is very important on the program I'm working on that Int() performs properly.
I kludged a work around in the mean time.

Public Function UInt (Byval V ) As Integer
Dim SV() As String
SV = Split(Str(V),".")
UInt = Val(SV(0))
End Function

I didn't mess with the Java source. I don't know enough about what I'm doing there.

Rate this thread
WoltLab Burning Board