PDA

View Full Version : StatusPaneCapslock and StatusPaneNumlock



Peter van Mil
8-Jun-2018, 07:45 AM
I have added to statusbar panes to the statusbar of Order.src. For some reason they don't appear on the screen. Nothing happens. In DataFlex 19.0 the panes appear in the lower right corner.

(I also would like to see an INS / OVR pane).



Object oStatusBar is a cCJStatusBar

Object oStatusPane1 is a cCJStatusBarPane
Set piID to sbpIDIdlePane
Set pbStyleStretch to True
End_Object

Object oStatusPane2 is a cCJStatusBarPane
Set phoViewPane to Self
Set pbStyleStretch to True
End_Object

Object oStatusPaneCapslock is a cCJStatusBarPane
Set piID to sbpIDCapslock
End_Object

Object oStatusPaneNumlock is a cCJStatusBarPane
Set piID to sbpIDNumLock
End_Object

End_Object

Stephen W. Meeley
8-Jun-2018, 08:07 AM
Peter,

I've confirmed this behavior. We'll look into it.

Peter van Mil
8-Jun-2018, 10:50 AM
Thanks Stephen.

Do you also look at the INS / OVR feature? It is in the Studio and I would like to use it in my software (as a standard DataFlex feature).

Dennis Piccioni
8-Jun-2018, 11:24 AM
Yes, we are looking into both issues.

Dennis Piccioni
15-Jun-2018, 05:06 PM
Hi Peter,

it looks like Codejock changed how they handle this. They used to provide the text for these special panes (CAPS, NUM, SCRL) and now they don’t. You must set these yourself.


Object oStatusPane3 is a cCJStatusBarPane
Set pbStyleStretch to True
Set piId to sbpIDCapslock
Set psText to "CAPS"
End_Object

The new behavior lets you use an image instead of text for one of these panes. You could not do this before.

Peter van Mil
16-Jun-2018, 06:15 AM
Hi Dennis,

Thanks for the update. If you know it, it's not a problem. It is even better, because the tekst "CAPS" is a little more clear than the previous default "CAP".

Still I want to find a solution for INS /OVR. This seems to be not supported by CodeJock, but the Studio is using it. Images also work.


12063

Dennis Piccioni
16-Jun-2018, 10:31 AM
Concerning the INS/OVR request. This is not easy to do automatically. We don’t think that there is a computer level setting for Insert of Overwrite mode – it seems to be set on an object by object basis. In the Studio we base this mode on the current editor view. During idle events, we check the insert mode of the Codemax editor and update the status pane. We had to write custom code to make this all work. For example, you can have two files open, one set in insert and the other set to overwrite.

Peter van Mil
16-Jun-2018, 12:36 PM
Aha, the INS/OVR isn't an easy feature. It is not that important, but it would be a nice feature if it was easy to implement.

Russell McDougall
18-Jun-2018, 04:54 AM
Try


Class cde_CJMenuStatusBarPaneInsertToggleState is a cCJStatusBarPane
Procedure Construct_Object
Forward Send Construct_Object
Set pstext to "INS" // Sets initial text
Set pbStyleNoBorders to False
End_Procedure

Procedure OnCreate
Forward Send OnCreate
Send ComSetPadding 8 0 8 0
Set ComBeginGroup to True
Set ComCustomizable to True
End_Procedure

Procedure DisplayToggleState
Boolean bInsertOverstrikeState
Move (getkeyState(VK_Insert)) to bInsertOverstrikeState
If (bInsertOverstrikeState=True) Begin
Set pstext to "INS"
End
Else Begin
Set psText to "OVR"
End
End_Procedure

End_Class



Peter If you get this working post tidied code back here.

Russell McDougall
18-Jun-2018, 05:47 AM
Define sbpIDCapslock for 59137 // Indicates whether CAPS Lock is on or off.
Define sbpIDNumLock for 59138 // Indicates whether Num Lock is on or off.
Define sbpIDScrollLock for 59139 // Indicates whether Scroll Lock is on or off

Peter there is also Scrollock handled identically to caps and mum

.

Peter van Mil
18-Jun-2018, 06:59 AM
Thanks Russell, I have got it working. I am using the OnUpdate procedure to update the Statuspane.
(Surprisingly the boolean bInsertOverstrikeState has to be False to show "INS").




Object oStatusBar is a cCJStatusBar
Object oStatusPaneInsertOver is a cCJStatusBarPane
Set peAlignment to xtpAlignmentCenter
Set piWidth to 27
Set pstext to "INS"

Procedure DisplayToggleState
Boolean bInsertOverstrikeState
Move (getkeyState(VK_Insert)) to bInsertOverstrikeState
If (bInsertOverstrikeState=False) Begin
Set psText to "INS"
End
Else Begin
Set psText to "OVR"
End
End_Procedure

End_Object

Object oStatusPaneCapslock is a cCJStatusBarPane
Set piId to sbpIDCapslock
Set psText to "CAPS"
End_Object

Object oStatusPaneNumlock is a cCJStatusBarPane
Set piID to sbpIDNumLock
Set psText to "NUM"
End_Object

Procedure OnUpdate
Send DisplayToggleState of oStatusPaneInsertOver
End_Procedure

End_Object