MiniGUI DBU
Posted: Fri Nov 02, 2018 7:27 pm
Hi Friends,
I've found a nice utility EMAG Software DBU by Enrico Giordano on Inet.
It was built with FiveWin library and xHarbour compiler.
This DBF Manager works very well but it have an Italian interface only.
The author didn't promise the other localization on the FiveWin forum.
Is it a problem
But we have already the power MiniGUI tool
My humble effort is below. There are the dummy tool buttons and menu actions now.
But it is have a basic TBROWSE features IMHO.
Your feedback is welcome
I've found a nice utility EMAG Software DBU by Enrico Giordano on Inet.
It was built with FiveWin library and xHarbour compiler.
This DBF Manager works very well but it have an Italian interface only.
The author didn't promise the other localization on the FiveWin forum.
Is it a problem
But we have already the power MiniGUI tool
My humble effort is below. There are the dummy tool buttons and menu actions now.
But it is have a basic TBROWSE features IMHO.
Code: Select all
/*
* MINIGUI - Harbour Win32 GUI library Demo
*
* Copyright 2018 Grigory Filatov <gfilatov@inbox.ru>
*
* Inspired by EMAG Software DBU https://www.emagsoftware.it
*/
REQUEST DBFCDX
#include "minigui.ch"
#include "tsbrowse.ch"
#include "dbinfo.ch"
#command INSERT [<b4: BEFORE>] => dbInsert( <.b4.> )
#xtranslate IsMaximized ( <hWnd> ) => IsZoomed ( <hWnd> )
#define PRG_TITLE 'MiniGUI DBU Template'
Static BRW_1
Static cIni
SET PROCEDURE TO dbInsert
Procedure Main( cDBFName )
Local lMaximized, nTop, nLeft, nWidth, nHeight
Local cFile, nW, nH
SET CENTURY ON
SET DATE BRITISH
SET EXCLUSIVE ON
SET AUTOSCROLL OFF
SET FONT TO "Tahoma", 9
SET DEFAULT ICON TO "ICONA"
DEFAULT cDBFName := "test"
IF EMPTY( File( cFileNoExt( cDBFName ) + ".fpt" ) )
rddSetDefault( "DBFNTX" )
ELSE
rddSetDefault( "DBFCDX" )
ENDIF
USE ( GetStartupFolder() + "\" + cDBFName )
cFile := dbInfo( DBI_FULLPATH )
cIni := ChangeFileExt( Application.ExeName, '.ini' )
BEGIN INI FILENAME (cIni)
GET lMaximized SECTION "Parameters" ENTRY "Maximized" DEFAULT .T.
GET nTop SECTION "Parameters" ENTRY "Top" DEFAULT 0
GET nLeft SECTION "Parameters" ENTRY "Left" DEFAULT 0
GET nWidth SECTION "Parameters" ENTRY "Width" DEFAULT 0
GET nHeight SECTION "Parameters" ENTRY "Height" DEFAULT 0
END INI
DEFINE WINDOW MainWin ;
MAIN ;
TITLE PRG_TITLE ;
ON MAXIMIZE Browse_OnSize() ;
ON SIZE Browse_OnSize() ;
ON RELEASE SaveMRUFileList()
IF !lMaximized
IF nTop >= 0
MainWin.Row := nTop
ENDIF
IF nLeft >= 0
MainWin.Col := nLeft
ENDIF
IF nWidth > 0
MainWin.Width := nWidth
ENDIF
IF nHeight > 0
MainWin.Height := nHeight
ENDIF
ENDIF
CreateMainMenu()
CreateToolBar()
DEFINE STATUSBAR KEYBOARD
END STATUSBAR
IF lMaximized
nW := GetDesktopWidth()
nH := MainWin.ClientHeight - GetToolBarHeight() - GetTitleHeight() + iif( IsThemed(), GetBorderHeight() + 2, 2 * GetBorderHeight() )
ELSE
nW := MainWin.ClientWidth + GetBorderWidth()
nH := MainWin.ClientHeight - GetToolBarHeight() - GetTitleHeight() - GetBorderHeight() / 2 - 2
ENDIF
CreateBrowse( GetToolBarHeight() + GetBorderHeight() / 2, 0, nW, nH )
SetHotKeys()
END WINDOW
AddMRUItem( cFile, Nil )
MainWin.Title := PRG_TITLE + " - " + cFile
IF lMaximized
MAXIMIZE WINDOW MainWin
ENDIF
ACTIVATE WINDOW MainWin
Return
****** End of Main ******
Static Procedure SetHotKeys()
// <INSERT> key processing
ON KEY INSERT ACTION { || AddRecord() }
ON KEY F2 ACTION _dummy()
ON KEY F3 ACTION _dummy()
ON KEY F4 ACTION _dummy()
ON KEY F5 ACTION { || Browse_Refresh() }
ON KEY F6 ACTION _dummy()
ON KEY F7 ACTION _dummy()
ON KEY F8 ACTION _dummy()
ON KEY F9 ACTION _dummy()
ON KEY F11 ACTION Browse_GotoFirstCol()
ON KEY F12 ACTION Browse_GotoLastCol()
ON KEY CONTROL+D ACTION DuplicateRec()
ON KEY CONTROL+I ACTION _dummy()
ON KEY CONTROL+R ACTION _dummy()
ON KEY CONTROL+T ACTION _dummy()
ON KEY CONTROL+X ACTION { || QuickExit() }
Return
....