QueryStatus
Syntax:
BOOL QueryStatus (long nCommand);
Return
Value: TRUE if the
command is applicable and FALSE otherwise.
Parameter:
nCommand Identifies the command to query status of (see Remarks).
Remarks:
The
ELS-QB component supports a variety of
commands that can be executed against the current contents of the SQL pane or Result window. These include commands to format the
text, cut and paste, select or find and more.The
commands are executed by calling the DoCommand() method and passing to it
one of the following command IDs of ELS-QB component:
QB_CMD_UNDO
= 1,
QB_CMD_REDO
= 2,
QB_CMD_CUT
= 3,
QB_CMD_COPY
= 4,
QB_CMD_PASTE
= 5,
QB_CMD_SELECTALL
= 6,
QB_CMD_FIND
= 7,
QB_CMD_REPLACE
= 8,
QB_CMD_PRINT
= 9,
QB_CMD_PRINT_PREVIEW
= 10,
QB_CMD_PAGE_SETUP
= 11
Call
this method passing the same command IDs to determine whether the command is
valid in the current state of the ELS-QB component,
for further conditional execution of the command.The
results returned by the method may also be used to update your application's
user interface.
Example:
Here is an exerpt from ELS_QBDemo project thah illustrates
the usage of QueryStatus
() method
of ELS-QB component.
void
CELS_QBDemoView::OnUpdateEditUndo(CCmdUI* pCmdUI)
{
pCmdUI->Enable(m_QBCtrl.QueryStatus(QB_CMD_UNDO));
}