org.jclarion.clarion.runtime
Class CWin

java.lang.Object
  extended by org.jclarion.clarion.runtime.CWin

public class CWin
extends java.lang.Object


Nested Class Summary
static class CWin.OverrideTarget
           
 
Constructor Summary
CWin()
           
 
Method Summary
static int accepted()
          Return control that posted accepted event
static void addDefaultFonts()
           
static void addFont(java.lang.String name)
           
static void alert(int key)
          setup alert notification for the specified key
static void alert(int lo, int hi)
          setup alert notification for the specified key range
static void aliasKey(int from, int to)
          Map one key to another
static void beep()
          Make default system noise
static void beep(int tone)
          Make specified system noise
static void box(int x, int y, int width, int height)
           
static void change(int field, ClarionObject value)
          Change Control object's value
static int choice()
          Get selected item in current field.
static int choice(int control)
          Determine selection in a control - i.e.
static void clearAliasKey(int key)
          Reset alias on a specified key
static void clearAllAliasKeys()
          Reset all aliased keys
static void closeTarget(AbstractTarget t)
           
static boolean colorDialog(java.lang.String title, ClarionNumber rgb, java.lang.Integer suppress)
          Popup a color chooser dialog.
static ClarionString contents(int control)
          Return contents, in string form for the specified control
static int createControl(int id, int type, java.lang.Integer parent)
          Create a new control object
static int createControl(int id, int type, java.lang.Integer parent, java.lang.Integer position)
           
static void disable(int field)
          Disable a control
static void disable(int lo, int hi)
          Disable range of controls
static void display()
          Update and Redraw all controls
static void display(int field)
          Update and Redraw specified control
static void display(int lo, int hi)
          Update and Redraw specified controls
static void enable(int field)
          Enable a control
static void enable(int low, int hi)
          Enable all controls in range
static int event()
          Return current event
static java.lang.String eventString()
           
static java.lang.String eventString(int event)
           
static int field()
          Return cntrol id of the control that generated current event
static boolean fileDialog(java.lang.String title, ClarionString target, java.lang.String ifiles, int options)
           
static int focus()
          Return control id that currently has focus
static boolean fontDialog(java.lang.String title, ClarionString typeFace, ClarionNumber size, ClarionNumber color, ClarionNumber style, ClarionNumber added)
          Popup a dialog that allows user to select font
static void forwardKey(int control)
          Pass key code to another control.
static ClarionString getClipboard()
           
static PropertyObject getControl(ClarionObject control)
          Get current control based on target setting
static PropertyObject getControl(int indx)
           
static int getFirstField()
          Return first control code in current target
static CWinImpl getInstance()
           
static int getLastField()
          Return last control code in current target
static int getMouseX()
          get Mouse X pos relative to ???
static int getMouseY()
          get Mouse Y pos relative to ???
static void getPosition(int control, ClarionNumber x, ClarionNumber y, ClarionNumber width, ClarionNumber height)
          Extract positional information for a given control and insert data into supplied fields
static AbstractTarget getTarget()
          Get current abstract target - report or window
static javax.swing.filechooser.FileSystemView getView()
           
static AbstractWindowTarget getWindowTarget()
          Get current abstract target - report or window
static void hide(int field)
          Hide a control
static int keyChar()
          set ASCII char value of keycode pressed
static int keyCode()
          Return key code generated on last event, or key code set by function setkeycode
static int keyState()
          Get keystate of control keys, shift, control etc
static int message(ClarionString message)
          Display modal message
static int message(ClarionString message, ClarionString header)
          Display modal message
static int message(ClarionString message, ClarionString header, java.lang.String icon)
          Display modal message
static int message(ClarionString message, ClarionString header, java.lang.String icon, int button)
          Display modal message
static int message(ClarionString message, ClarionString header, java.lang.String icon, int button, int defButton)
          Display modal message
static int message(ClarionString message, ClarionString header, java.lang.String icon, int button, int defButton, int style)
          Display modal message
static boolean notification(ClarionNumber code)
          get notification
static boolean notification(ClarionNumber code, ClarionNumber thread)
           
static boolean notification(ClarionNumber code, ClarionNumber thread, ClarionNumber parameter)
           
static void notify(int code)
           
static void notify(int code, int thread)
          Send notify to another thread
static void notify(int code, java.lang.Integer thread, java.lang.Integer parameter)
           
static int popup(java.lang.String message)
          Draw a popup window
static int popup(java.lang.String message, java.lang.Integer x, java.lang.Integer y)
           
static void post(int event)
          Post event to current window
static void post(java.lang.Integer event, java.lang.Integer control, java.lang.Integer window)
          Post event to specific control in a specific window
static void post(int event, int control)
          Post event to specific control in current window
static void pressKey(int code)
          Insert keycode into keyboard buffer.
static boolean printerDialog(ClarionString title, java.lang.Integer mode)
          Select a printer
static void register(int event, java.lang.Runnable trigger, int key)
          Register an event listener
static void removeControl(int id)
          delete a control object
static void removeControl(int from, int to)
          Delete control objects in specified range
static void select()
          Enter acceptall mode
static void select(int control)
          Select a control
static void select(int control, int start)
          Select a control at a given start position.
static void select(int control, int start, int end)
          Select control and mark start/end range.
static void select(java.lang.Object o, int start)
          Select a control at a given start position.
static void setClipboard(ClarionString content)
           
static void setCursor()
          Set mouse cursor look to default
static void setCursor(java.lang.String cursor)
          Set mouse cursor look
static void setFileSystemView(javax.swing.filechooser.FileSystemView view)
           
static void setFont(int control, java.lang.String typeface, java.lang.Integer size, java.lang.Integer color, java.lang.Integer style, java.lang.Integer charset)
          Set control object font
static void setKeyChar(int code)
          set ASCII char value of keycode pressed
static void setKeyCode(int code)
          Set key code to be returned by calls to keycode
static void setPosition(int control, java.lang.Integer x, java.lang.Integer y, java.lang.Integer width, java.lang.Integer height)
          Set position of a control object
static void setTarget()
          set control target to default open target
static void setTarget(AbstractTarget target)
          set control target to a different abstracttarget
static void unhide(int field)
          Unhide a control
static void unhide(int from, int to)
          Unhide all controls in specified range
static void unregister(int event, java.lang.Runnable trigger, int key)
          Deregister an event listener
static void update()
          Update all use fields with control values
static void update(int field)
          Update use field with control value
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CWin

public CWin()
Method Detail

getInstance

public static CWinImpl getInstance()

notify

public static void notify(int code,
                          int thread)
Send notify to another thread


notify

public static void notify(int code)

notify

public static void notify(int code,
                          java.lang.Integer thread,
                          java.lang.Integer parameter)

notification

public static boolean notification(ClarionNumber code)
get notification


notification

public static boolean notification(ClarionNumber code,
                                   ClarionNumber thread)

notification

public static boolean notification(ClarionNumber code,
                                   ClarionNumber thread,
                                   ClarionNumber parameter)

message

public static int message(ClarionString message)
Display modal message

Parameters:
message -
Returns:

message

public static int message(ClarionString message,
                          ClarionString header)
Display modal message

Parameters:
message -
header -
Returns:

message

public static int message(ClarionString message,
                          ClarionString header,
                          java.lang.String icon)
Display modal message

Parameters:
message -
header -
icon -
Returns:

message

public static int message(ClarionString message,
                          ClarionString header,
                          java.lang.String icon,
                          int button)
Display modal message

Parameters:
message -
header -
icon -
button -
Returns:

message

public static int message(ClarionString message,
                          ClarionString header,
                          java.lang.String icon,
                          int button,
                          int defButton)
Display modal message

Parameters:
message -
header -
icon -
button -
defButton -
Returns:

message

public static int message(ClarionString message,
                          ClarionString header,
                          java.lang.String icon,
                          int button,
                          int defButton,
                          int style)
Display modal message

Parameters:
message -
header -
icon -
button -
defButton -
style - - 1 = system modal. 0 = app model. Ignored by swing implementation
Returns:

display

public static void display()
Update and Redraw all controls


display

public static void display(int field)
Update and Redraw specified control

Parameters:
field -

display

public static void display(int lo,
                           int hi)
Update and Redraw specified controls

Parameters:
field -

change

public static void change(int field,
                          ClarionObject value)
Change Control object's value

Parameters:
field -

disable

public static void disable(int field)
Disable a control

Parameters:
field -

disable

public static void disable(int lo,
                           int hi)
Disable range of controls

Parameters:
field -

enable

public static void enable(int field)
Enable a control

Parameters:
field -

enable

public static void enable(int low,
                          int hi)
Enable all controls in range

Parameters:
lo -
hi -

hide

public static void hide(int field)
Hide a control

Parameters:
field -

unhide

public static void unhide(int field)
Unhide a control

Parameters:
field -

unhide

public static void unhide(int from,
                          int to)
Unhide all controls in specified range

Parameters:
from -
to -

update

public static void update(int field)
Update use field with control value

Parameters:
field -

update

public static void update()
Update all use fields with control values


select

public static void select(int control)
Select a control

Parameters:
control -

select

public static void select()
Enter acceptall mode


getControl

public static PropertyObject getControl(ClarionObject control)
Get current control based on target setting

Parameters:
control -
Returns:

getControl

public static PropertyObject getControl(int indx)

select

public static void select(int control,
                          int start)
Select a control at a given start position. i.e. list or entry etc

Parameters:
control -
start -

select

public static void select(java.lang.Object o,
                          int start)
Select a control at a given start position. Try and figure out what control based on Object instead of control id

Parameters:
o -
start -

select

public static void select(int control,
                          int start,
                          int end)
Select control and mark start/end range. i.e. text select

Parameters:
control -
start -
end -

choice

public static int choice(int control)
Determine selection in a control - i.e. selected rownum in a list

Parameters:
control -
Returns:

choice

public static int choice()
Get selected item in current field.

Returns:

post

public static void post(int event)
Post event to current window

Parameters:
event -

post

public static void post(int event,
                        int control)
Post event to specific control in current window

Parameters:
event -
control -

post

public static void post(java.lang.Integer event,
                        java.lang.Integer control,
                        java.lang.Integer window)
Post event to specific control in a specific window

Parameters:
event -
control -
window -

contents

public static ClarionString contents(int control)
Return contents, in string form for the specified control

Parameters:
control -
Returns:

field

public static int field()
Return cntrol id of the control that generated current event

Returns:

focus

public static int focus()
Return control id that currently has focus

Returns:

event

public static int event()
Return current event

Returns:

eventString

public static java.lang.String eventString()

eventString

public static java.lang.String eventString(int event)

accepted

public static int accepted()
Return control that posted accepted event

Returns:

keyCode

public static int keyCode()
Return key code generated on last event, or key code set by function setkeycode

Returns:

alert

public static void alert(int key)
setup alert notification for the specified key

Parameters:
key -

alert

public static void alert(int lo,
                         int hi)
setup alert notification for the specified key range

Parameters:
key -

setTarget

public static void setTarget(AbstractTarget target)
set control target to a different abstracttarget

Parameters:
key -

setTarget

public static void setTarget()
set control target to default open target

Parameters:
key -

getTarget

public static AbstractTarget getTarget()
Get current abstract target - report or window


closeTarget

public static void closeTarget(AbstractTarget t)

getWindowTarget

public static AbstractWindowTarget getWindowTarget()
Get current abstract target - report or window


addDefaultFonts

public static void addDefaultFonts()

addFont

public static void addFont(java.lang.String name)

createControl

public static int createControl(int id,
                                int type,
                                java.lang.Integer parent)
Create a new control object

Parameters:
id -
type -
parent -
Returns:

createControl

public static int createControl(int id,
                                int type,
                                java.lang.Integer parent,
                                java.lang.Integer position)

removeControl

public static void removeControl(int id)
delete a control object

Parameters:
id -

removeControl

public static void removeControl(int from,
                                 int to)
Delete control objects in specified range

Parameters:
from -
to -

setPosition

public static void setPosition(int control,
                               java.lang.Integer x,
                               java.lang.Integer y,
                               java.lang.Integer width,
                               java.lang.Integer height)
Set position of a control object

Parameters:
control -
x -
y -
width -
height -

getPosition

public static void getPosition(int control,
                               ClarionNumber x,
                               ClarionNumber y,
                               ClarionNumber width,
                               ClarionNumber height)
Extract positional information for a given control and insert data into supplied fields

Parameters:
control -
x -
y -
width -
height -

setFont

public static void setFont(int control,
                           java.lang.String typeface,
                           java.lang.Integer size,
                           java.lang.Integer color,
                           java.lang.Integer style,
                           java.lang.Integer charset)
Set control object font

Parameters:
control -
typeface -
size -
color -
style -
charset -

setCursor

public static void setCursor(java.lang.String cursor)
Set mouse cursor look

Parameters:
cursor -

setCursor

public static void setCursor()
Set mouse cursor look to default


beep

public static void beep()
Make default system noise


beep

public static void beep(int tone)
Make specified system noise

Parameters:
tone -

setKeyCode

public static void setKeyCode(int code)
Set key code to be returned by calls to keycode

Parameters:
code -

setKeyChar

public static void setKeyChar(int code)
set ASCII char value of keycode pressed

Parameters:
code -

pressKey

public static void pressKey(int code)
Insert keycode into keyboard buffer. Hopefully SWT will allow us to do this

Parameters:
code -

keyChar

public static int keyChar()
set ASCII char value of keycode pressed

Returns:

forwardKey

public static void forwardKey(int control)
Pass key code to another control. Hopefully SWT will permit this

Parameters:
control -

popup

public static int popup(java.lang.String message)
Draw a popup window

Parameters:
message - window to draw. | delimiter separates items ~ prefix disables an option + prefix draws check mark - prefix no draw check mark {} in option defines sub options. Can be deeply nested right aligns proceeding text [ PROP:ICON + ( name ) ] = draw icon first
Returns:

popup

public static int popup(java.lang.String message,
                        java.lang.Integer x,
                        java.lang.Integer y)

printerDialog

public static boolean printerDialog(ClarionString title,
                                    java.lang.Integer mode)
Select a printer

Parameters:
title -
mode -
Returns:

getView

public static javax.swing.filechooser.FileSystemView getView()

setFileSystemView

public static void setFileSystemView(javax.swing.filechooser.FileSystemView view)

fileDialog

public static boolean fileDialog(java.lang.String title,
                                 ClarionString target,
                                 java.lang.String ifiles,
                                 int options)

colorDialog

public static boolean colorDialog(java.lang.String title,
                                  ClarionNumber rgb,
                                  java.lang.Integer suppress)
Popup a color chooser dialog. Place result in Number rgb

Parameters:
title -
rbg -
suppress - - if set to one then suppress selection of standard colors
Returns:

fontDialog

public static boolean fontDialog(java.lang.String title,
                                 ClarionString typeFace,
                                 ClarionNumber size,
                                 ClarionNumber color,
                                 ClarionNumber style,
                                 ClarionNumber added)
Popup a dialog that allows user to select font

Parameters:
title - - dialog title
typeFace - - typeface to display
size - - font size
color - - font color
style - - font style. Italic, bold etc
added - - null = truetype fonts only. 0 = window fonts. 1 = printer fonts. 2 = both
Returns:

clearAliasKey

public static void clearAliasKey(int key)
Reset alias on a specified key


clearAllAliasKeys

public static void clearAllAliasKeys()
Reset all aliased keys


aliasKey

public static void aliasKey(int from,
                            int to)
Map one key to another

Parameters:
from -
to -

keyState

public static int keyState()
Get keystate of control keys, shift, control etc


getClipboard

public static ClarionString getClipboard()

setClipboard

public static void setClipboard(ClarionString content)

getLastField

public static int getLastField()
Return last control code in current target

Returns:

getFirstField

public static int getFirstField()
Return first control code in current target

Returns:

getMouseX

public static int getMouseX()
get Mouse X pos relative to ???

Returns:

getMouseY

public static int getMouseY()
get Mouse Y pos relative to ???

Returns:

register

public static void register(int event,
                            java.lang.Runnable trigger,
                            int key)
Register an event listener

Parameters:
event -
trigger -

unregister

public static void unregister(int event,
                              java.lang.Runnable trigger,
                              int key)
Deregister an event listener


box

public static void box(int x,
                       int y,
                       int width,
                       int height)


Copyright © 2010. All Rights Reserved.