CanRedoEditor

Gadget ›› EditorGadget ››
Parent Previous Next

CanRedoEditor

Синтаксис

Function CanRedoEditor(ByVal gadget As Long) As Integer

Описание

Возвращает результат возможности сделать операцию возврата отмененного действия (для EditorGadget).

Параметры

gadget - номер гаджета

Платформы

Windows

Пример

#Include "window9.bi"
Dim shared As integer event,ToolBar
Dim As HWND hwnd
hwnd=OpenWindow("1",300,10,240,290)
EditorGadget(1,10,40,200,200)
ToolBar=CreateToolBar()
ToolBarStandardButton(ToolBar,2,STD_UNDO)
ToolBarStandardButton(ToolBar,3,STD_REDOW)
ToolBarStandardButton(ToolBar,4,STD_PASTE)
Sub test_
  If CanUndoEditor(1)=0 Then
     SetButtonToolBarState(ToolBar ,2 , 2 , 1)
  Else
     SetButtonToolBarState(ToolBar ,2 , 2 , 0)
  EndIf
  If CanRedoEditor(1)=0 Then
     SetButtonToolBarState(ToolBar ,3 , 2 , 1)
  Else
     SetButtonToolBarState(ToolBar ,3 , 2 , 0)
  EndIf
End Sub
Do
  event= WaitEvent()
  If event=EventClose Then End
  If event=EventGadget Then
     Select Case EventNumber
        Case 2
           UndoEditor(1)'Undo
        Case 3
           RedoEditor(1)'Redo
        Case 4
           PasteEditor(1,GetClipBoardText)' Paste
     End Select
     test_
  EndIf
Loop

Результат

Created with the Personal Edition of HelpNDoc: Easily create EBooks