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.

Gerhard

Beginner

  • "Gerhard" started this thread

Posts: 14

Date of registration: Apr 16th 2010

  • Send private message

1

Friday, April 16th 2010, 10:37am

Enterkey behaviour

Hello to all !



I'm new in this community.

I tried some things in Jabaco which are very important for me.

One of this is the "Enter Key Behaviour" in Editboxes.

Jabaco uses the VB / .NET way of jumping from one box to the next - with Tab.

This is the Microsoft-Standard, but not what I need.

I'm writing software for inventory management, cash systems, and for the componies organisation and administration.

The mostly "things" are entered are numbers. So the number-block of the keyboard is the most important part of this work. But the Enterkey doesn't work. Using the Tab-key for going to the next editbox is not practicable at all.

Think about a cash system. In one hand you have an barcode-scanner, with the other you enter quantity and maybe the price - on the numberblock. And than you have to use the tab-key ? Thats not practicable at all.



So my question: Is their a chance to implement the Enter-key as doing that what tab does ? Some other IDE's have a property called "EnterKeyBehaviour". Maybe there is a way in Jabaco. But I don't know which.



Generally Jabaco seems to be a good alternative to VB / VB.Net. And the best of all: It produces jar-files.

Some bugs are in the IDE. Is Jabaco still under construction ? When will come a new release ?



Thank you for answering this questions

Gerhard from Austria

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

Friday, April 16th 2010, 2:06pm

Grüß Gott Gerhard!
the following sample demonstrates how to intercept the Enter key and jump forth and back between TextBox controls.

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
Option Explicit

Public Sub Form_Load()
      Text1.Text = ""
      Text2.Text = ""
      Text1.SetFocus 
End Sub

Public Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer)
      trace "Text1_KeyDown " & KeyCode & ";" & Shift 
End Sub

Public Sub Text1_KeyPress(KeyAscii As Integer)
      trace "Text1_KeyPress " & KeyAscii
      
      If KeyAscii = 10 Then
         ' user pressed Enter or Return
         Text2.SetFocus  
      End If
End Sub

Public Sub Text1_Change(ChangeType As ChangeType, ChangeEvt As DocumentEvent)
      trace "Text1_Change " & ChangeType & ";" & ChangeEvt
End Sub

Public Sub Text2_KeyDown(KeyCode As Integer, Shift As Integer)
      trace "Text2_KeyDown " & KeyCode & ";" & Shift 
End Sub

Public Sub Text2_KeyPress(KeyAscii As Integer)
      trace "Text2_KeyPress " & KeyAscii
      
      If KeyAscii = 10 Then
         ' user pressed Enter or Return
         Text1.SetFocus  
      End If
End Sub

Public Sub Text2_Change(ChangeType As ChangeType, ChangeEvt As DocumentEvent)
      trace "Text2_Change " & ChangeType & ";" & ChangeEvt
End Sub


Private Sub trace(msg As String)
   Debug.Print msg
End Sub


This should solve your requirement. Does it?

You are right assuming that Jabaco is still under development.
The Jabaco toolset is being developed by Manuel, the "father of Jabaco".
The Jabaco framework, a set of Jabaco/Java classes is open source.
Volunteers are welcome!

If you spot errors and deficiencies not already mentioned in this forum,
your remarks are welcome. Other contributions like samples, suggestions
and amendments to the framework would be welcome too!

Happy experimenting!

A1880

Gerhard

Beginner

  • "Gerhard" started this thread

Posts: 14

Date of registration: Apr 16th 2010

  • Send private message

3

Friday, April 16th 2010, 3:12pm

Thank's a lot for your message A1880.

Well, to do this, like your example shows, is a lot of work if you have to do it with every control you need to press enter. For example: I'm looking foreward to write the new version of my inventory management in a language which is system independant. The current version in in Access.

I'm coming from VB / VB.Net / VBA, so it will be much easier for me to do the new version in a system like Jabaco which has a very VB-like syntax and can produce systemindependant jar-files.

Well, the current version has 197 forms, some with more than 50 controls - most of it editboxes. The complete software is mouse-independant. All functions can be reached with keys. this makes it easier for the users.

My wish is, that the EnterKey-Behaviour is a property of the controls. This would make it easier for me.



One bug concerns to the Label-Control. If you try to change the BackColor (button ...), then the BorderColor will be changed.



Thanks again

Gerhard

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

Friday, April 16th 2010, 3:52pm

Hi,
you could invent your own TextBox control as a derivative of the original TextBox with the intended behaviour.
In Jabaco you have several options to do that:
- Write a "UserControl" as part of your project
(this is probably the easiest way for a start; user controls are quick to design, test and change)
- Change the existing TextBox implementation by adding a property or extend the Jabaco framework by a derived TextBox
(look a the source of TextBox.jsrc and write a Jabaco sub-class)
- Write your own additional framework which you include in your project as external *.jar file

Please post your bug reports as separate postings in the respective forum category.
Otherwise, it becomes tedious for developers to get your findings transferred to their to do list.

Success!

A1880

Gerhard

Beginner

  • "Gerhard" started this thread

Posts: 14

Date of registration: Apr 16th 2010

  • Send private message

5

Friday, April 16th 2010, 7:14pm

Thanks a lot A1880 !



I will try what you told me.

As I saw, there is a forum for reporting bugs. I will collect them and thenI post it there.

Do you know if and when a new released will be distributed ?



Gerhard

fallon416

Beginner

Posts: 28

Date of registration: Mar 26th 2010

  • Send private message

6

Friday, April 16th 2010, 8:39pm

I'm not sure if Jabaco does textbox arrays like vb. If they do you could just loop through them and set the keyascii value.

Neil

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

7

Friday, April 16th 2010, 9:02pm

Arrays of controls are feasible

Arrays of controls are feasible in Jabaco but a bit different compared to VB6.
Look here for an example.

Greetings!

A1880

Rate this thread
WoltLab Burning Board