Intermec ck1 Reference Guide
Chapter 4 — SDK Components
188
CK1 SDK Programmer’s Reference Manual
OnReturnPress Event
Purpose: Occur when you press Enter.
Prototype:
void user_function(OtkEntry* oep);
Parameter: oep
Pointer of the specified entry that occurs at the OnReturnPress
event
event
Return: None
Example Code
The following example uses an OtkEntry widget to show “hello world !!”
at screen position (50,100) and allows you to edit the content using the
keyboard and mouse.
at screen position (50,100) and allows you to edit the content using the
keyboard and mouse.
#include "otkapplication.h"
#include "otkentry.h"
// widgets
OtkControl contr1;
OtkEntry entry1;
int main()
{
otk_app_init(160, 142);
otk_control_init (&contr1);
otk_control_set_size (&contr1, 240, 320);
otk_widget_set_gc_background_color (OTK_WIDGET(&contr1), OTK_COL_WHITE);
otk_app_add(&contr1);
otk_control_show(&contr1);
// set entry1
otk_entry_init (&entry1);
otk_entry_set(&entry1,NULL, 50, 100,123,20);
otk_entry_set_buffer(&entry1, "hello world !!", 14);
otk_control_add_child (&contr1, OTK_WIDGET(&entry1));
return otk_app_loop();
}
#include "otkentry.h"
// widgets
OtkControl contr1;
OtkEntry entry1;
int main()
{
otk_app_init(160, 142);
otk_control_init (&contr1);
otk_control_set_size (&contr1, 240, 320);
otk_widget_set_gc_background_color (OTK_WIDGET(&contr1), OTK_COL_WHITE);
otk_app_add(&contr1);
otk_control_show(&contr1);
// set entry1
otk_entry_init (&entry1);
otk_entry_set(&entry1,NULL, 50, 100,123,20);
otk_entry_set_buffer(&entry1, "hello world !!", 14);
otk_control_add_child (&contr1, OTK_WIDGET(&entry1));
return otk_app_loop();
}
OtkMaskEdit
OtkMaskEdit is a single-line editor with an input mask. OtkMaskEdit was
inherited from OtkWidget and OtkEditable. The properties are:
inherited from OtkWidget and OtkEditable. The properties are:
Property
Description
“mask”(char*:Read)
Points to a buffer with mask
format in it.
format in it.
“mask_unentered_char”(char:Read)
Replaces all the unentered
characters in the text buffer.
characters in the text buffer.