Beijer Electronics (formerly QSI Corporation)

Manufacturer of Mobile Data and Human Machine Interface Terminals.
It is currently Sat Nov 18, 2017 10:40 am

All times are UTC - 7 hours




Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: Tue Jun 26, 2012 9:37 am 
Offline

Joined: Thu Oct 09, 2008 2:37 pm
Posts: 13
Hi,
Using a popup screen with edit box a numberkeypad for user entry. The pop up screen will be invoked via press of an EZCircle object. Problem I am having is that the numberkeypad will not pop up. Below is the code:

EZCircle object:
func handlepress()

' handle the set scope button press
PopupScreen_SetScope.enabled = true
EditBox_SetScope.enabled = true
endfunc

PopupscreenV2 object: PopupScreen_SetScope

init parent := default
init xpos := 197
init ypos := 318
init width := 340
init height := 170
init value := "Enter Target Scope"
init enterbutton := true
init enabled := false


func EnterButtonPressed() returns boolean

PopupScreen_SetScope.enabled = false

return true
endfunc


func CancelButtonPressed() returns boolean
PopupScreen_SetScope.enabled = false

return true
endfunc


EditBoxV2 object: EditBox_SetScope

init parent := popupscreen_setscope
init xpos := 35
init ypos := 66
init width := 275
init height := 35
init boxtype := eb_singleline
'init autoEdit := true
init editType := eb_ReadWrite


func ScreenPress(xdown as integer, ydown as integer) returns boolean
handles MSG_SCREEN_PRESS

if (_kt_focusObj <> me) then
_KeySetFocus(me, false)
endif

return true
endfunc

func focusOn()

NumberKeypad_1.value = 0.0
NumberKeypad_1.enabled = true

endfunc

func focusOff()

NumberKeypad_1.enabled = false

endfunc

NumberKeyPadV2 object: NumberKeypad_1:

init parent := default
init popupStyle := _NKP_StdPopup
init autohide := false
init ClickOnPress := true
init AutoClear := true
init HasBackBtn := true
init HasCancel := true
init HasDecimal := true
init HasEnter := true
init HasPlusMinus := true
init HasValueBox := true
init PasswordMode := false
init enabled := false
init xpos := 247
init ypos := 191
init width := 442
init height := 221


func EnterPressed()

' handle new target scope entry
if (NumberKeypad_1.value >= float(SysParamsIntegers[I_MIN_DPLY_LENGTH]) and ->
NumberKeypad_1.value <= float(SysParamsIntegers[I_MAX_DPLY_LENGTH])) then
' set the new target scope
val(fTargetScope, EditBox_SetScope.Value)

' send a message to globals
' man, silly thing don't like it if a handler in specific object is used.
' may have to extract the object template and add the handler there.
UserDirectMsg(default, SCOPE_ENTERED_MSG, 0, false)
else
' set to invalid value
fTargetScope = float(SysParamsIntegers[I_MIN_DPLY_LENGTH]) - 1.0
EditBox_Message.value = "Value Entered Out of Range"
PopupScreen_Message.enabled = true
endif

NumberKeypad_1.enabled = false

endfunc

func CancelPressed()

NumberKeypad_1.value = 0.0
NumberKeypad_1.enabled = false

endfunc

Any suggestions why the NumberKeypad won't popup?

---

Ken


Top
 Profile  
 
PostPosted: Tue Jun 26, 2012 9:50 am 
Offline
User avatar

Joined: Thu Mar 02, 2006 2:12 pm
Posts: 487
Location: Salt Lake City, Utah
When do you want the NumberKeypad to appear? When the popup screen appears or when the edit box is pressed?

To show a numberKeypad the code looks like:

Code:
numberkeypad_1.enabled = true
SendToFront(numberkeypad_1)

_________________
Ron L.

http://www.beijerelectronicsinc.com/


Top
 Profile  
 
PostPosted: Tue Jun 26, 2012 12:02 pm 
Offline

Joined: Thu Oct 09, 2008 2:37 pm
Posts: 13
Hi Ron,
Would like the NumberKeypad to pop up when the edit box is touched.

Thanks,
Ken


Top
 Profile  
 
PostPosted: Tue Jun 26, 2012 12:43 pm 
Offline
User avatar

Joined: Thu Mar 02, 2006 2:12 pm
Posts: 487
Location: Salt Lake City, Utah
You could put some code similar to this in your EditBox instance.

Code:
init parent := default
init xpos := 140
init ypos := 70
init width := 180
init height := 80
init boxtype := eb_multilinescroll

func ScreenRelease (xup as integer, yup as integer) returns boolean
    handles MSG_SCREEN_RELEASE
    numberkeypad_1.enabled = true
    SendToFront(numberkeypad_1)
    return default (xup, yup)
endfunc

_________________
Ron L.

http://www.beijerelectronicsinc.com/


Top
 Profile  
 
PostPosted: Tue Jun 26, 2012 12:44 pm 
Offline
User avatar

Joined: Thu Mar 02, 2006 2:12 pm
Posts: 487
Location: Salt Lake City, Utah
You could also put a transparent button in front of the edit box and use it's click event.

Code:
init value := "button_1"
init parent := default
init xpos := 150
init ypos := 80
init width := 170
init height := 60
init transparent := true

func click()
    numberkeypad_1.enabled = true
    SendToFront(numberkeypad_1)
endfunc

_________________
Ron L.

http://www.beijerelectronicsinc.com/


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC - 7 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group