Are you sure?
GUI menu is a bad thing.
Check on samples the function buildmenu()
Not sure if this can help, because I use a recursive array.
STATIC FUNCTION MenuWvg( mMenuOpt )
LOCAL oMenu
oMenu := wvgSetAppWindow():MenuBar()
BuildMenu( oMenu, mMenuOpt )
...
FUNCTION BuildMenu( oMenu, acMenu )
LOCAL oElement, oSubMenu, cbCode, m_ProgTxt
FOR EACH oElement IN acMenu
IF Len( oElement[ 2 ] ) == 0
m_Prog := oElement[ 3 ]
IF ValType( m_Prog ) == "C"
cbCode := [{ || RunModule( "] + m_Prog + [", "] +
m_ProgTxt + [" ) }]
oMenu:AddItem( oElement[ 1 ] , &( cbCode ) )
ELSE
oMenu:AddItem( oElement[ 1 ], oElement[ 3 ] )
ENDIF
ELSE
oSubMenu := WvgMenu():new( oMenu, , .T. ):Create()
BuildMenu( oSubMenu, oElement[ 2 ] )
oMenu:AddItem( oSubMenu, oElement[ 1 ] )
ENDIF
NEXT
RETURN NIL
Array have this format:
{ cCaption, {}, cModule }
Second parameter may be another array with same format, with a submenu.
Third parameter may be a text or a codeblock
José M. C. Quintas
I have built and successfully used a tool, WVWClip, for doing just what you are about to do but it is based on GTWVW.
Good part is that your original Clipper code will require minimum of changes. I can share my work with you.
GUI menu is a bad thing.
Check on samples the function buildmenu()
Not sure if this can help, because I use a recursive array.
Hi PeteLook at this function which is self-explanatory.But this menu option may be special - as you want to intercept inkey() loop:oMenu:AddItem( "Exit" , {|| __Keyboard( K_ESC ) } )Vis this mechanism you can push keys in keyboard buffer and handled via inkey(). Is this sufficient ?
--
--
You received this message because you are subscribed to the Google
Groups "Harbour Users" group.
Unsubscribe: harbour-user...@googlegroups.com
Web: http://groups.google.com/group/harbour-users
---
You received this message because you are subscribed to the Google Groups "Harbour Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to harbour-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/harbour-users/edfd8c83-81ba-4f28-9936-adb26d3dce5a%40googlegroups.com.
Pete,I invite you to think twice about switching the menu system.My program has a very basic, let's say "3270 era" menu system. Everytime you make a selection, a new menu opens, nidified. In this way users can - from whatever point in the menu system they are, just press ESC several times (ESC exits the current menu and control returns to the previous) up to the main menu (ESC doesn't working on main menu).So, to create an invoice, from any menu they are they can press ESC ESC ESC ESC ESC 4 1 1 and the "emit invoice form opens". or ESC ESC ESC ESC 6 3 1 to open the form to check if a client have sums to pay...I think that forcing them to use mouse may make them lose time...What to do when you open a form for creating a invoice? would you disable the menu until the form is closed? Or would you start using MT to have several forms opened (it would be my dream)?
On Thu, May 28, 2020 at 12:27 PM Pete <pete...@gmail.com> wrote:
--Hi all,Any gtwvg power user around here? ;-)
I've been asked to renovate an old (but reliably working) application.
I'm thinking to add some GUI "bells & whistles", starting from a (windows like) GUI Menu.The rest UI will be remain as is, and gradually in the future I'll, possibly, add, some additionalGUY elements. For now, that's all I want to do. Just a GUI menu.The question(s) is, is it possible to be done as described and if yes,
has anybody got (and wants to share) a `SIMPLE` sample code, for this thing?
I've looked in `gtwvg\tests` but I found it a little-bit more complicated than I wished it to be.
Any contribution, "as simple as possible and even more simple", is very welcome!regards,Pete
--
You received this message because you are subscribed to the Google
Groups "Harbour Users" group.
Unsubscribe: harbou...@googlegroups.com
Web: http://groups.google.com/group/harbour-users
---
You received this message because you are subscribed to the Google Groups "Harbour Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to harbou...@googlegroups.com.
Pete,I invite you to think twice about switching the menu system.
My program has a very basic, let's say "3270 era" menu system. Everytime you make a selection, a new menu opens, nidified. In this way users can - from whatever point in the menu system they are, just press ESC several times (ESC exits the current menu and control returns to the previous) up to the main menu (ESC doesn't working on main menu).
... Or would you start using MT to have several forms opened (it would be my dream)?
Unsubscribe: harbour-user...@googlegroups.com
Web: http://groups.google.com/group/harbour-users
---
You received this message because you are subscribed to the Google Groups "Harbour Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to harbour-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/harbour-users/491efe82-d6de-4982-9e4d-93d9998191fb%40googlegroups.com.
Hello Pete,Attached is a sample application using GTWVG. It uses ideas from WVWClip. Please compile as shown below.
To view this discussion on the web visit https://groups.google.com/d/msgid/harbour-users/491efe82-d6de-4982-9e4d-93d9998191fb%40googlegroups.com.
Hi Ash.
On Saturday, 30 May 2020 17:27:09 UTC+3, Ash wrote:Hello Pete,Attached is a sample application using GTWVG. It uses ideas from WVWClip. Please compile as shown below.Hi Ash,
thank you very much for your sample-code. Now, we are making some real progress... ;-)
Pete, buenas noches.
Pete,
> Wouldn't multiple active open windows be confusing to the user?
> If the program is well constructed, there should be very little reason to use two windows at the same time.
>And the few times it's helpful, one could run two copies of the program.
INIT PROCEDURE MainInit()
// better than : SET MULTIPLE OFF WARNING
LOCAL cTitle := 'HBFM ' + cVersion
LOCAL hWndDlg := FindWindowEx(,,, cTitle )
IF !( hWndDlg == 0 )
SetForegroundWindow( hWndDlg )
BringWindowToTop( hWndDlg )
ShowWindow( hWndDlg, 1 )
UpdateWindow( hWndDlg )
QUIT // It is a second instance. Bye Bye
ENDIF
RETURN
FUNCTION Main
// here Main begin
Pete,I invite you to think twice about switching the menu system.My program has a very basic, let's say "3270 era" menu system. Everytime you make a selection, a new menu opens, nidified. In this way users can - from whatever point in the menu system they are, just press ESC several times (ESC exits the current menu and control returns to the previous) up to the main menu (ESC doesn't working on main menu).So, to create an invoice, from any menu they are they can press ESC ESC ESC ESC ESC 4 1 1 and the "emit invoice form opens". or ESC ESC ESC ESC 6 3 1 to open the form to check if a client have sums to pay...I think that forcing them to use mouse may make them lose time...What to do when you open a form for creating a invoice? would you disable the menu until the form is closed? Or would you start using MT to have several forms opened (it would be my dream)?
On Thu, May 28, 2020 at 12:27 PM Pete <pete...@gmail.com> wrote:
--Hi all,Any gtwvg power user around here? ;-)
I've been asked to renovate an old (but reliably working) application.
I'm thinking to add some GUI "bells & whistles", starting from a (windows like) GUI Menu.The rest UI will be remain as is, and gradually in the future I'll, possibly, add, some additionalGUY elements. For now, that's all I want to do. Just a GUI menu.The question(s) is, is it possible to be done as described and if yes,
has anybody got (and wants to share) a `SIMPLE` sample code, for this thing?
I've looked in `gtwvg\tests` but I found it a little-bit more complicated than I wished it to be.
Any contribution, "as simple as possible and even more simple", is very welcome!regards,Pete
--
You received this message because you are subscribed to the Google
Groups "Harbour Users" group.
Unsubscribe: harbou...@googlegroups.com
Web: http://groups.google.com/group/harbour-users
---
You received this message because you are subscribed to the Google Groups "Harbour Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to harbou...@googlegroups.com.
Hello Marek,
Hi
I in my case, added this function (from webpage of Jose Quintas):
#include "hbdyn.ch"
// esta funcionou
Function WAPI_GetSysColor( pGetSysColor )
Local hHandleDll := 0, nColor := 0
HB_SYMBOL_UNUSED( hHandleDll )
HB_SYMBOL_UNUSED( nColor )
hHandleDll := hb_LibLoad("user32.dll")
nColor := hb_DynCall( { "GetSysColor", hHandleDll,
HB_DYN_CALLCONV_STDCALL }, pGetSysColor ); HB_SYMBOL_UNUSED(
nColor )
hb_LibFree( hHandleDll )
Return nColor
I hope this helps.
BR
GVARONAS
Unsubscribe: harbour-user...@googlegroups.com
Web: http://groups.google.com/group/harbour-users
---
You received this message because you are subscribed to the Google Groups "Harbour Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to harbour-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/harbour-users/e72253dc-1e08-40d7-a7ed-e778ef114da5%40googlegroups.com.
The only `stopper` for someone to exploit the capabilities of GTWVG is not the "usual suspect", the documentation, :-)but, IMO, the lack of small compile-able samples, displaying the functionality of different GUI elements and functions of the library.
--
--
You received this message because you are subscribed to the Google
Groups "Harbour Users" group.
Unsubscribe: harbour-user...@googlegroups.com
Web: http://groups.google.com/group/harbour-users
---
You received this message because you are subscribed to the Google Groups "Harbour Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to harbour-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/harbour-users/e1cfba4e-cc9c-486d-b30f-f2a1db533bedn%40googlegroups.com.
My menu is an array.
I do not like windows menu, but can use it.
STATIC FUNCTION MenuWvg( mMenuOpt )
LOCAL oMenu, nKey
oMenu := wvgSetAppWindow():MenuBar()
BuildMenu( oMenu, mMenuOpt )
DO WHILE .T.
nKey := Inkey( INKEY_IDLE )
DO CASE
CASE nKey == HB_K_GOTFOCUS
CASE nKey == HB_K_LOSTFOCUS
CASE nKey == K_ESC
EXIT
ENDCASE
ENDDO
wvgSetAppWindow():oMenu := NIL
wapi_SetMenu( wapi_GetActiveWindow(), NIL )
wapi_DestroyMenu( oMenu:hWnd )
RETURN NIL
FUNCTION BuildMenu( oMenu, acMenu )
LOCAL oElement, oSubMenu, cbCode, m_ProgTxt
FOR EACH oElement IN acMenu
IF Len( oElement[ 2 ] ) == 0
m_Prog := oElement[ 3 ]
IF ValType( m_Prog ) == "C"
m_ProgTxt := AppEmpresaApelido() + " (" +
AppUserName() + ") (" + m_Prog + ") " + Upper( oElement[ 1 ] )
cbCode := [{ || RunModule( "] + m_Prog + [", "] +
m_ProgTxt + [" ) }]
oMenu:AddItem( oElement[ 1 ] , &( cbCode ) )
ELSE
oMenu:AddItem( oElement[ 1 ], oElement[ 3 ] )
ENDIF
ELSE
oSubMenu := WvgMenu():new( oMenu, , .T. ):Create()
BuildMenu( oSubMenu, oElement[ 2 ] )
oMenu:AddItem( oSubMenu, oElement[ 1 ] )
ENDIF
NEXT
RETURN NIL
For array creation:
nMenuLevel := 0
oMenuOptions := {}
MenuOption( "Faturamento" )
MenuDrop()
MenuOption( "Pedidos/Notas/Manifesto" )
MenuDrop()
MenuOption( "Orçamentos/Pedidos",
"PJPPEDIDO" )
MenuOption( "Orçamentos/Pedidos SubOpções" )
MenuDrop()
MenuOption( "(I)Ped.Cancelamento",
"ADMPEDCAN" )
MenuOption( "(I)Reemite Cupom pra Pedido",
"PJPPEDIDOCUPOM" )
MenuOption( "(I)Ped.Duplicar Pedidos",
"ADMPEDCLO" )
MenuUndrop()
MenuUndrop()
MenuUnDrop()
//
STATIC FUNCTION MenuOption( cCaption, cModule, bCode )
LOCAL nCont, oLastMenu
oLastMenu := oMenuOptions
FOR nCont = 1 TO nMenuLevel
oLastMenu := oLastMenu[ Len( oLastMenu ) ]
oLastMenu := oLastMenu[ 2 ]
NEXT
AAdd( oLastMenu, { cCaption, {}, cModule, bCode, 1 } )
RETURN NIL
STATIC FUNCTION MenuDrop()
nMenuLevel++
RETURN NIL
STATIC FUNCTION MenuUnDrop()
nMenuLevel--
RETURN NIL
José M. C. Quintas
To view this discussion on the web visit https://groups.google.com/d/msgid/harbour-users/CADhhxhyvATNz3rDx1vZhoF0oK5C%2B3KU05%3D_MmMJVC7oFohab4Q%40mail.gmail.com.
Same code I already send.
José M. C. Quintas
To view this discussion on the web visit https://groups.google.com/d/msgid/harbour-users/d326d6a5-6af9-4709-aa79-700305a2d478n%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/harbour-users/a5ae42a3-e4f4-3159-98f8-204fa3272c57%40gmail.com.
On tests I mix GTWVG with HWGUI, HMG, HMG Extended, OOHG.
I do not have console module, use GTWVG for all.
I use multithread, then each module have it's own thread, and more than one module can be opened at same time, including the same.
Console uses the Windows console, I think it is not a good option
to mix.
José M. C. Quintas
---
You received this message because you are subscribed to the Google Groups "Harbour Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to harbour-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/harbour-users/ca25fadd-20bd-4b1b-bc55-66f2df3418een%40googlegroups.com.
Using REQUEST HB_GT_WIN_DEFAULT, you are using console, not GTWVG.
Change to REQUEST HB_GT_WVG_DEFAULT
Note: when using GUI/GTWVG, may be you need a new errorsys, I
change it to write to HB_OUT.LOG and open on notepad.
José M. C. Quintas
To view this discussion on the web visit https://groups.google.com/d/msgid/harbour-users/2bee50f1-4fd9-4f1d-a8ea-99bc8a5af6a8n%40googlegroups.com.
my mistake:
REQUEST HB_GTWVG_DEFAULT
José M. C. Quintas
| Assunto: | Re: [harbour-users] Re: simple GTWVG sample code? |
|---|---|
| Data: | Thu, 1 Dec 2022 13:53:31 -0300 |
| De: |
| José M. C. Quintas <jmcqu...@gmail.com> |
Hi PeteJust remove or comment-out these lines from demowvg.prg. and you will get a pure console window without GETs GUIed.oLastMenu:disableItem( 11 )oLastMenu:checkItem( 1 )oLastMenu:insItem( 11, { "I am inserted later !", ;{|| wvg_MessageBox( , "Hi " + iif( oLastMenu:isItemChecked( 1 ), "Yes", "No" ) + ;iif( oLastMenu:isItemEnabled( 12 ), " Yes", " No" ) ) } } )oLastMenu:setItem( 14, { "This is Set Against Prev Menu", {|| wvg_MessageBox( , "Hi" ) } } )SetMode( MaxRow() + 1, MaxCol() + 1 ) /* Needed to accommodate attached menu */SetKey( K_F12 , {|| hb_gtInfo( HB_GTI_ACTIVATESELECTCOPY ) } )SetKey( K_CTRL_V , {|| __Keyboard( hb_gtInfo( HB_GTI_CLIPBOARDDATA ) ) } )SetKey( K_RBUTTONDOWN, {|| __Keyboard( hb_gtInfo( HB_GTI_CLIPBOARDDATA ) ) } )hPopup := wvt_SetPopupMenu()pGT := SetGT( 1, hb_gtSelect() )/* Force mouse pointer right below the Harbour label */wvt_SetMousePos( 2, 40 )AAdd( aBlocks, {|| wvt_SetIcon( GetResource( "vr_1.ico" ) ) } )AAdd( aBlocks, {|| Wvt_SetTitle( "Vouch" ) } )AAdd( aBlocks, {|| wvt_DrawLabel( 1, 40, cLabel, 6,, RGB( 255, 255, 255 ), RGB( 198, 198, 198 ), "Arial", 26, , , , , .T., .T. ) } )AAdd( aBlocks, {|| wvt_DrawBoxRaised( nTop, nLft, nBtm, nRgt ) } )AAdd( aBlocks, {|| wvt_DrawBoxRecessed( 7, 61, 13, 70 ) } )AAdd( aBlocks, {|| wvt_DrawBoxGroup( 15, 59, 18, 72 ) } )AAdd( aBlocks, {|| wvt_DrawBoxGroup( 5, 6, 19, 44 ) } )AAdd( aBlocks, {|| wvt_DrawImage( 8, 62, 12, 69, IMAGE_VOUCH, , .T. ) } )AAdd( aBlocks, {|| wvt_DrawBoxRecessed( 7, 48, 13, 55 ) } )AAdd( aBlocks, {|| wvt_DrawLine( MaxRow() - 2, 0, MaxRow() - 2, MaxCol(), WVT_LINE_HORZ, WVT_LINE_RECESSED, WVT_LINE_BOTTOM ) } )AAdd( aBlocks, {|| wvt_DrawLine( MaxRow() - 1, 41, MaxRow(), 41, WVT_LINE_VERT, WVT_LINE_RECESSED, WVT_LINE_CENTER ) } )AAdd( aBlocks, {|| AEval( GetList, {| oGet | wvt_DrawBoxGet( oGet:Row, oGet:Col, Len( Transform( oGet:VarGet(), oGet:Picture ) ) ) } ) } )AAdd( aBlocks, {|| wvt_Mouse( -1000001 ) } )aLastPaint := WvtSetBlocks( aBlocks )/* Xbase++ compatible pure GUI controls onto CUI console */BuildButtons()It is as simple as that. GUI controls are glued on top of pure character interface. You need not to if so desired.Pritpal Bedia student of software analysis & concepts
Submenu is the same as menu.
You create a menu and add as an option on another menu.
My primary use is gtwvg with multithread, together with hwgui and fivewin, on same EXE.
Look this, creating menu from array with any level.
oMenu := wvgSetAppWindow():MenuBar()
BuildMenu( oMenu, mMenuOpt )
FUNCTION BuildMenu( oMenu, acMenu )
LOCAL oElement, oSubMenu, cbCode, xFrmNameTxt
FOR EACH oElement IN acMenu
IF Len( oElement[ 2 ] ) == 0
oMenu:AddItem( oElement[ 1 ], oElement[ 3 ] ) // here
add a single option
ELSE
oSubMenu := WvgMenu():new( oMenu, , .T. ):Create() //
here create the submenu
BuildMenu( oSubMenu, oElement[ 2 ] )
oMenu:AddItem( oSubMenu, oElement[ 1 ] ) // here add
submenu as an option
ENDIF
NEXT
RETURN NIL
--
You received this message because you are subscribed to the Google Groups "Harbour Users" group.
Unsubscribe: harbour-user...@googlegroups.com
Web: https://groups.google.com/group/harbour-users
---
You received this message because you are subscribed to the Google Groups "Harbour Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to harbour-user...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/harbour-users/e007c510-7656-454b-90e2-c9a6371936e9n%40googlegroups.com.
I use a traditional menu creation, may be gtwvg, hwgui, fivewin, minigui.
Use same style on Visual Basic 6 a long time ago.
As an array, it is easy to add or remove options, and setup for each user/password.
MEMVAR xFrmName, nMenuLevel, oMenuOptions
FUNCTION MenuCria()
PRIVATE nMenuLevel, oMenuOptions
hb_Default( @lInterno, .T. )
nMenuLevel := 0
oMenuOptions := {}
MenuOption( "Faturamento" )
MenuDrop()
MenuOption( "Pedidos/Notas/Manifesto" )
MenuDrop()
MenuOption( "Orçamentos/Pedidos",
"PJPPEDIDO" )
MenuOption( "-", "-" ) // separator
MenuOption( "Orçamentos/Pedidos SubOpções" )
MenuDrop()
MenuOption( "(I)Ped.Cancelamento",
"ADMPEDCAN" )
MenuOption( "Any codeblock", { || Nil } )
MenuUndrop()
MenuUnDrop()
RETURN oMenuOptions
STATIC FUNCTION MenuOption( cCaption, cModule, bCode )
LOCAL nCont, oLastMenu
oLastMenu := oMenuOptions
FOR nCont = 1 TO nMenuLevel
oLastMenu := oLastMenu[ Len( oLastMenu ) ]
oLastMenu := oLastMenu[ 2 ]
NEXT
AAdd( oLastMenu, { cCaption, {}, cModule, bCode, 1 } )
RETURN NIL
STATIC FUNCTION MenuDrop()
nMenuLevel++
RETURN NIL
STATIC FUNCTION MenuUnDrop()
nMenuLevel--
RETURN NIL
FUNCTION MenuWvg( mMenuOpt )
LOCAL oMenu, nKey
oMenu := wvgSetAppWindow():MenuBar()
BuildMenu( oMenu, mMenuOpt )
DO WHILE .T.
nKey := Inkey( INKEY_IDLE )
DO CASE
CASE nKey == HB_K_GOTFOCUS
CASE nKey == HB_K_LOSTFOCUS
CASE nKey == K_ESC
EXIT
ENDCASE
ENDDO
wvgSetAppWindow():oMenu := NIL
wapi_SetMenu( wapi_GetActiveWindow(), NIL )
wapi_DestroyMenu( oMenu:hWnd )
RETURN NIL
FUNCTION BuildMenu( oMenu, acMenu )
LOCAL oElement, oSubMenu, cbCode, xFrmNameTxt
FOR EACH oElement IN acMenu
IF Len( oElement[ 2 ] ) == 0
xFrmName := oElement[ 3 ]
IF ValType( xFrmName ) == "C"
xFrmNameTxt := AppEmpresaApelido() + " (" +
AppUserName() + ") (" + xFrmName + ") " + Upper( oElement[ 1 ] )
cbCode := [{ || RunModule( "] + xFrmName + [", "]
+ xFrmNameTxt + [" ) }]
oMenu:AddItem( oElement[ 1 ] , &( cbCode ) )
ELSE
oMenu:AddItem( oElement[ 1 ], oElement[ 3 ] ) //
codeblock
ENDIF
ELSE
oSubMenu := WvgMenu():new( oMenu, , .T. ):Create()
BuildMenu( oSubMenu, oElement[ 2 ] )
oMenu:AddItem( oSubMenu, oElement[ 1 ] )
ENDIF
NEXT
RETURN NIL
José M. C. Quintas
To view this discussion visit https://groups.google.com/d/msgid/harbour-users/7ce46396-e62b-4e02-b990-177a09015829n%40googlegroups.com.
It is ready to use, why create another?
I use it for traditional or GUI
{ "name of the option", {}, "module", { || block() }, 1 }
Submenu is added to second option, unlimited level
What is the problem on doing this:
IF !L_PRODUCTION
MenuOption( "Developer" )
MenuDrop()
MenuOption( "MF Test Func", { || Test() } )
MenuOption( "-", "-" )
MenuOption( "Refresh MVP Points",{|| RefreshMVP( "MENU" ) }
)
MenuOption( "Switch Shareware", {|| SwitchShareware()
} )
MenuUnDrop()
ENDIF
MenuOption( "Matches" )
MenuDrop()
MenuOption( "View Match", {|| SelectFixture("VIEW") } )
IF CCA_ADMIN
MenuOption( "Add New Match", {|| EnterAnalysis("NEW") } )
MenuOption( "Import Match", {|| EnterAnalysis("IMPORT") } )
MenuOption( "Edit Match", {|| SelectFixture("EDIT") } )
ENDIF
MenuUnDrop()
MenuOption( "Analysis" )
MenuDrop()
MenuOption( "Cumulative Individual" , {|| Averages("CI")
} )
MenuOption( "Seasonal Individual" , {|| Averages("SI")
} )
MenuOption( "Captaincy & Toss Individual" , {||
Averages("CAPTAIN") } )
MenuOption( "Appearances Individual" , {|| Averages("A")
} )
MenuOption( "Cumulative Team" , {|| Averages("T")
} )
MenuOption( "Seasonal Team" , {|| Averages("ST")
} )
MenuOption( "All Records Team" , {|| Averages("E")
} )
MenuOption( "Player Form", {|| Averages("FORM") } )
MenuOption( "Player Selection", {|| Averages("PS") } )
MenuOption( "Player Retention", {|| Averages("PR") } )
MenuUnDrop()
MenuOption( "Data Files" )
MenuDrop()
MenuOption( "Players", {|| VariBrowse("PLAYERS") } )
MenuOption( "Opponents", {|| VariBrowse("OPPONENTS") } )
MenuOption( "Team Types", {|| VariBrowse("TEAMTYPE") } )
MenuUnDrop()
MenuOption( "Maintenance" )
MenuDrop()
IF CCA_ADMIN
MenuOption( "Merge Player Records" , {|| MergePlayer() } )
MenuOption( "Re-Index Files" , {||
ReindexFiles("FUNC") } )
MenuOption( "Pack Files", {|| ReindexFiles("PACK") } )
MenuOption( "Cumulative Validation" , {|| SumCheck("MENU") }
)
ENDIF
MenuOption( "Membership Check", {|| MembershipCheck() } )
IF CCA_ADMIN
MenuOption( "Reset Memberships", {|| ResetMemberships() } )
ENDIF
MenuUndrop()
MenuOption( "Other" )
MenuDrop()
MenuOption( "Quit", {|| CCAExit() } )
IF CCA_ADMIN
MenuOption( "Set Junior Age", {|| SetJuniorAge() } )
MenuOption( "Set Score Format", {|| SetScoreFormat() } )
MenuOption( "Set Season Break", {|| SetSplitYear() } )
IF .T. // control->shareware
MenuOption( "Register", {|| RegisterCCA() } )
ELSE
MenuOption( "Check for Update", {|| CheckForAppUpdate() }
)
MenuOption( "Test Print", {|| Print("TEST") } )
ENDIF
ENDIF
MenuOption( "User Guide", {|| Help("MANUAL") } )
MenuOption( "About " + CCA_SHORT_NAME, {|| About() } )
MenuUndrop()
José M. C. Quintas
To view this discussion visit https://groups.google.com/d/msgid/harbour-users/1d28bb25-e1ec-4396-87fe-72f44123e5een%40googlegroups.com.
I send all source code with them on previous emails.
MenuOption() allways add on array of current level.
MenuDrop() and MenuUndrop() moves the level up/down.
They are not part of WVG.
Adjust all these functions for your needs
José M. C. Quintas
To view this discussion visit https://groups.google.com/d/msgid/harbour-users/84047d6b-9ec8-4ed5-bba8-883bde4db027n%40googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/harbour-users/2909ccbb-a288-4f2f-8a17-c88bab634b36n%40googlegroups.com.
--
Hello Martin Fears
There are several ways to accomplish what you want — both in the open-source world and in commercial tools. Since my experience is mainly with free solutions, I can only comment within that scope, focusing on HMG Extended.
The download link has already been shared above, and within that package you’ll find more than one IDE option, including one that can generate forms for you, even with basic CRUD support. For someone returning to programming after many years, it’s perfectly normal to feel a bit lost — today we have many options and not enough clear documentation.
My practical suggestion is this:
download HMG Extended (https://hmgextended.com/download.html) and explore the samples folder.
It contains hundreds of examples ranging from very simple to fairly advanced. However, this does require you to spend some time digging through the material. In open-source communities, all work is voluntary, so it’s difficult for anyone to stop and create something completely tailored from scratch. Personally, I can only provide more targeted help when the requester brings a concrete case or at least some initial code — otherwise we may spend time building something that ends up being far from what was really needed.
If, after reviewing the examples, you like the syntax and the final results, you can try the Designer (https://www.hmgextended.com/test-one.html), another free tool mentioned earlier. You can find several tutorials on YouTube — just search for “designer” + “minigui”. Keep in mind that these are community-made resources, created by fellow developers simply trying to help. They may not be polished, but they’re often very useful.
HMG Extended is open-source, but its current maintainer, Grigory, offers excellent support and curated distribution packages to users who contribute regularly to the project. This can save you many hours of searching through documentation, so I recommend getting in touch with Grigory to learn more.(minigu...@googlegroups.com)
All the best, and good luck with your project migration!
Do not exists a magic solution on harbour.
Depends how many "GUI" you want about the result.
On GUI, each element is a window, may not to be the gt window, and user may think that application crashes if no code about this.
On gtwvg, may be better do not try use controls that need focus, like EDIT, and/or browse, but you can use another controls.
For buttons, you have 2 options:
a) use WVT_Paint, to allways redraw graphical part, when update gt
b) use API Windows controls, and destroy or disable or show/hide - I prefer to use multithread
I use buttons like an toolbar, and use a class to create/change buttons, I think it is easy on this way.
Buttons to make keyboard, on this way, you get buttons without to change source code too much.
I use modified controls, check changes to original pushbutton.
And this is part of a class
nCol := 0
FOR EACH oElement IN ::aGUIButtons
oControl := wvgtstPushbutton():New()
oControl:PointerFocus := .F. // to do not change focus
from gt
oControl:Style += BS_TOP // icon+text, need manifest
oControl:Create( ::oCrt, , { -::nTop, iif( nCol == 0,
-0.1, -nCol ) }, { -::nButtonHeight, -::nButtonWidth },,,.F. )
oControl:SetCaption( IconFromCaption( oElement[ 2 ],
@cTooltip ) ) // icon
oControl:SetCaption( Substr( oElement[ 2 ], At( ">",
oElement[ 2 ] ) + 1 ) ) // text
oControl:Activate := BuildBlockKeyPut( oElement[ 1 ] ) //
create keyboard
oControl:TooltipText( cTooltip )
AAdd( ::aControlList, { CONTROL_TYPE_BUTTON, oControl } )
nCol += ::nButtonWidth
NEXT
If you have on your application F3, F4, F5, F6.....
You create buttons and set to make keyboard F3, F4, F5, F6, ....
On this way, your application continues with the routines for F3, F4, F5, F6, but user can click on buttons.
When needed, use button:hide(), button:show(), button:destroy(), button:enable(), button:Disable()
Using the class, I can change all at a time.
METHOD GUIHide() INLINE AEval( ::aControlList, { |
oElement | oElement[ 2 ]:Hide() } )
METHOD GUIShow() INLINE AEval( ::aControlList, { |
oElement | oElement[ 2 ]:Show() } ),
wvgSetAppWindow():InvalidateRect()
METHOD GUIDestroy() INLINE AEval( ::aControlList, { |
oElement | oElement[ 2 ]:Destroy(), oElement[ 2 ] := Nil } ),
::aControlList := {}, wvgSetAppWindow():Refresh()
METHOD GUIEnable() INLINE AEval( ::aControlList, { |
oElement | oElement[ 2 ]:Enable() } )
METHOD GUIDisable() INLINE AEval( ::aControlList, { |
oElement | oElement[ 2 ]:Disable() } )
It is a stand alone work, each one make it's own routines, to do not need to add extra code on all application.
And each one tests what can be better to own application, or to source code that wants to use.
It is very difficult to show my code, it will be needed too many time, and not about gtwvg.
What about this?
PROCEDURE PJPTABCCUSTO
LOCAL oFrm := JPTABCCUSTOClass():New()
oFrm:Execute()
CLOSE DATABASES
RETURN
CREATE CLASS JPTABCCUSTOClass INHERIT frmCadastroClass
VAR cDataTable INIT "JPTABCCUSTO"
VAR cDataField INIT "IDCCUSTO"
VAR axKeyValue INIT { 0 }
VAR cnSQL
...
Or this other:
PROCEDURE PJPPEDIDO
LOCAL nCont, cFiltro := "", mTmp
LOCAL oFrm := JPPEDIDOClass():New()
AAdd( oFrm:acMenuOptions, "<S>Confirma" )
AAdd( oFrm:acMenuOptions, "<L>Imprime" )
AAdd( oFrm:acMenuOptions, "<V>Val.Adic" )
AAdd( oFrm:acMenuOptions, "<F>Financ" )
IF AppUserLevel() == 0
AAdd( oFrm:acMenuOptions, "<Q>Estoque" )
ENDIF
...
oFrm:Execute()
CLOSE DATABASES
RETURN
or screens using multithread + gtwvg + fivewin + hwgui
José M. C. Quintas
To view this discussion visit https://groups.google.com/d/msgid/harbour-users/2909ccbb-a288-4f2f-8a17-c88bab634b36n%40googlegroups.com.
Because editing previous post, I remove text about last image
On my EXE I use multithread, GTWVG, FIVEWIN and HWGUI, can use dialog from any library.
Last image is a browse dialog using FIVEWIN, I use on application for browses.
On application I have:
- browse wvg for dbf
- browse wvg for ADO/MySQL
- browse fivewin for dbf
- browse fivewin for ADO/MySQL
- and my dlgauto for tests, automatic dialogs using any library (on application fivewin and hwgui only)
Notes:
Multithread is not for any library
Libraries together is not for any library, there are too many duplicated symbols between some libraries
original gtwvg.hbc adds ch files to all prgs, this causes conflict with some libraries, remove headers= and add directly #include on gtwvg prg files when needed.
José M. C. Quintas
To view this discussion visit https://groups.google.com/d/msgid/harbour-users/1689f421-39e6-4724-855d-a755f3acd4een%40googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/harbour-users/515467f1-d318-4b65-915a-e440218fdfbc%40gmail.com.
Hello;
To transition a purely procedural Clipper application to a graphical environment, it is essential to proceed with considerable caution. This is a structural change, not merely an aesthetic one. In many cases—especially when the system is already consolidated, complex, and no longer commercialized—it may not make sense to build a graphical version. I use the term “build” because, in practice, there is no literal migration: you essentially start a new system with a different methodology, leveraging only the knowledge gained from the previous one.
With a good data model and proper use of SQL features, many routines that previously required hundreds of lines of code can be resolved through simple SQL statements. When tables are properly redesigned, applying rules and logical relationships directly in the database, the amount of validation and handling required in the code is significantly reduced.
Additionally, the logic of a graphical system is fundamentally different from a console-based one. A procedural environment has a rigid and predictable flow, whereas a GUI is completely event-driven. The user can interact with different parts of the screen at any moment, which demands a different approach to validations, flow control, and consistency. For this reason, I find it more appropriate to centralize business rules and validations primarily at the time of saving, reducing dependency on interface-level controls.
The shortcuts and interactions typical of a TUI can indeed be replaced by controls more suitable for a graphical environment. However, it is common for us to try to replicate the old system’s logic and behavior in the new environment, and this often leads to frustration—because, in practice, it does not make sense.
My advice is to start slowly: master SQL first, then explore basic examples from a graphical library, and only then evaluate whether a full transition truly delivers meaningful benefits. Otherwise, the process can become exhausting and discouraging.
I speak from personal experience. My journey began in the early 2000s, in a context with very few available resources. I had several restarts and abandoned attempts until I finally established a stable foundation with Minigui. Throughout this time, I repeatedly heard that Clipper would soon disappear, that Harbour had no future—yet it continues to evolve and deliver excellent results.
Good morning,
A translated text does not always fully convey the original thought or idea.
In fact, the graphical interface has no direct relationship with DBF or SQL. That comparison was only meant to illustrate that, when rewriting a system with future growth in mind, SQL brings many improvements and allows many problems to be solved with far less code. After gaining a better understanding of our friend’s system, I realized that this is not the case here. Even so, since it is a small system, it has significant value as a learning exercise, as starting with something simple is always beneficial—although that is a separate discussion.
Best regards to everyone.