Skip to content

Commit

Permalink
Added: OnActivate and OnDeActivate events to MDI Child, Fixed: Tab on…
Browse files Browse the repository at this point in the history
… MDI Child
  • Loading branch information
XusinboyBekchanov committed Aug 10, 2022
1 parent 1af7e84 commit b49dd88
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
4 changes: 2 additions & 2 deletions mff/Application.bas
Expand Up @@ -280,9 +280,9 @@ Namespace My
If FActiveForm <> 0 Then
If FActiveForm->Accelerator Then TranslateAndDispatch = TranslateAccelerator(FActiveForm->Handle, FActiveForm->Accelerator, @msg) = 0
If TranslateAndDispatch Then
Select Case Msg.message
Select Case msg.message
Case WM_KEYDOWN
Select Case Msg.wParam
Select Case msg.wParam
Case VK_TAB ', VK_LEFT, VK_UP, VK_DOWN, VK_RIGHT, VK_PRIOR, VK_NEXT
'If Not GetFocus() = FActiveForm->Handle Then
FActiveForm->SelectNextControl(GetKeyState(VK_SHIFT) And 8000)
Expand Down
10 changes: 9 additions & 1 deletion mff/Form.bas
Expand Up @@ -1131,6 +1131,14 @@ Namespace My.Sys.Forms
Case WM_INITMENUPOPUP
' Case WM_TIMER
' If OnTimer Then OnTimer(This)
Case WM_MDIACTIVATE
If msg.lParam = msg.hWnd Then
pApp->ActiveForm = @This
If OnActivate Then OnActivate(This)
End If
If msg.wParam = msg.hWnd Then
If OnDeActivate Then OnDeActivate(This)
End If
Case WM_ACTIVATE
Select Case msg.wParamLo
Case WA_ACTIVE, WA_CLICKACTIVE
Expand Down Expand Up @@ -1258,7 +1266,7 @@ Namespace My.Sys.Forms

Private Sub Form.ShowItems(Ctrl As Control Ptr)
#ifdef __USE_GTK__
If CInt(Ctrl->FVisible) OrElse CInt(gtk_is_notebook(gtk_widget_get_parent(Ctrl->widget))) Then
If CInt(Ctrl->FVisible) OrElse CInt(GTK_IS_NOTEBOOK(gtk_widget_get_parent(Ctrl->widget))) Then
If Ctrl->box Then gtk_widget_show(Ctrl->box)
If Ctrl->scrolledwidget Then gtk_widget_show(Ctrl->scrolledwidget)
If Ctrl->eventboxwidget Then gtk_widget_show(Ctrl->eventboxwidget)
Expand Down

0 comments on commit b49dd88

Please sign in to comment.