4D Write v16WR LOCK COMMAND |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
4D Write v16
WR LOCK COMMAND
|
WR LOCK COMMAND ( area ; cmdNumber ; locked ) | ||||||||
Parameter | Type | Description | ||||||
area | Longint |
![]() |
4D Write area | |||||
cmdNumber | Longint |
![]() |
Number of the command to process | |||||
locked | Integer |
![]() |
0=enables the execution 1=does not enable the execution | |||||
The WR LOCK COMMAND command allows you to prevent the user from being able to execute the command whose number is passed in cmdNumber. This can concern either a menu command or a palette command. This command affects the user's access to the indicated command only in the 4D Write area referenced by area. Access to the command is unaffected in other 4D Write areas.
In the locked parameter, you can pass one of the following constants, found in the "WR Parameters" theme:
Constant | Type | Value | Comment |
wr enabled command | Longint | 0 | The command will be executed when it is called |
wr locked command | Longint | 1 | The command will not execute when it is called and will be disabled (grayed out) in the menus and palettes where it appears |
Notes:
Although the commands of a disabled menu cannot be selected, keyboard equivalents or toolbar buttons can still be used. If you want to completely lock these commands, you must call WR LOCK COMMAND specifically for each menu item.
Note: The list of menus, commands and their reference is available in in the “WR Commands” constants theme. You can either pass a constant name or its values.
You want the designer to be the only user that can access the Design environment:
If(Current user="Designer")
WR LOCK COMMAND(Area;wr cmd insert 4D expression;wr enabled command)
Else
WR LOCK COMMAND(Area;wr cmd insert 4D expression;wr locked command)
End if
If the user name is not "Guru", the user will not be allowed to create new documents:
If(Form event=On Load)
If(Current user#"Guru")
WR LOCK COMMAND(Area;wr cmd new;wr locked command)
End if
End if
Product: 4D Write
Theme: WR Area Control
Number:
89446
Created: 4D Write 6.5
4D Write Language ( 4D Write v16)