HMG Help

Exclusive forum for HMG, a Free / Open Source xBase WIN32/64 Bits / GUI Development System
  1. Thanks Grigory,
    your sample works fine.

    Dominique

    Statistics: Posted by dominique_devuyst — Fri Aug 16, 2019 12:49 pm


  2. Hello,
    I try to edit a combobox item with ON DISPLAYCHANGE .
    ...
    Does somebody have an explanation to this?
    Hello Dominique,

    It is an expected behavior because a ComboBox value in the ON DISPLAYCHANGE event is equal zero (it is not connected with an any combo value).

    Please try the following updated working sample:

    CODE:

    /** HMG ComboBox Demo* (c) 2002 Roberto Lopez*/#include "hmg.ch"static x := 1Function MainDEFINE WINDOW Form_1 ;AT 0,0 ;WIDTH 400 ;HEIGHT 200 ;TITLE 'ComboBox Demo' ;MAIN DEFINE MAIN MENUDEFINE POPUP 'Test'MENUITEM 'Get Value' ACTION MsgInfo(Str(Form_1.Combo_1.Value))MENUITEM 'Set Value' ACTION Form_1.Combo_1.Value := 1MENUITEM 'Get DisplayValue' ACTION MsgInfo( Form_1.Combo_1.DisplayValue )MENUITEM 'Set DisplayValue' ACTION Form_1.Combo_1.DisplayValue := 'New Text' MENUITEM 'Set Item' ACTION Form_1.Combo_1.Item (3) := 'New Text' MENUITEM 'Get Item' ACTION MsgInfo ( Form_1.Combo_1.Item (3) )END POPUPEND MENU@ 10,10 COMBOBOX Combo_1 ;ITEMS { 'A' , 'B' , 'C' } ;VALUE x ;DISPLAYEDIT ;ON CHANGE x := This.Value ;ON DISPLAYCHANGE Item_edit()END WINDOWCENTER WINDOW Form_1ACTIVATE WINDOW Form_1Return***********function Item_edit***********Form_1.Combo_1.Item(x):=Form_1.Combo_1.DisplayValuereturn
    8-)

    Statistics: Posted by gfilatov — Fri Aug 16, 2019 9:58 am


  3. Hello,
    I try to edit a combobox item with ON DISPLAYCHANGE .
    I start with the Samples\ComBo_4 Demo modified as follow :

    CODE:

    /** HMG ComboBox Demo* (c) 2002 Roberto Lopez*/#include "hmg.ch"Function MainDEFINE WINDOW Form_1 ;AT 0,0 ;WIDTH 400 ;HEIGHT 200 ;TITLE 'ComboBox Demo' ;MAIN DEFINE MAIN MENUDEFINE POPUP 'Test'MENUITEM 'Get Value' ACTION MsgInfo(Str(Form_1.Combo_1.Value))MENUITEM 'Set Value' ACTION Form_1.Combo_1.Value := 1MENUITEM 'Get DisplayValue' ACTION MsgInfo( Form_1.Combo_1.DisplayValue )MENUITEM 'Set DisplayValue' ACTION Form_1.Combo_1.DisplayValue := 'New Text' MENUITEM 'Set Item' ACTION Form_1.Combo_1.Item (3) := 'New Text' MENUITEM 'Get Item' ACTION MsgInfo ( Form_1.Combo_1.Item (3) )END POPUPEND MENU@ 10,10 COMBOBOX Combo_1 ;ITEMS { 'A' , 'B' , 'C' } ;VALUE 1 ;DISPLAYEDIT ;ON DISPLAYCHANGE Item_edit(This.value) //PlayBeep() END WINDOWCENTER WINDOW Form_1ACTIVATE WINDOW Form_1Return***********function Item_edit***********parameter xForm_1.Combo_1.Item(x):=Form_1.Combo_1.DisplayValuereturn
    and I have this strange result (see attachment) :
    He add a new item each time I press a key.
    Does somebody have an explanation to this?
    ComboBox_demo_edit.png

    Statistics: Posted by dominique_devuyst — Fri Aug 16, 2019 9:13 am


  4. Hi all

    how create a window transparent

    i see one example many years ago on version 1.xx of minigui, and now need this example.
    Hi Juan Rendón,

    Please try the following sample:

    CODE:

    /* * MINIGUI - Harbour Win32 GUI library Demo * * Copyright 2002-2009 Roberto Lopez <harbourminigui@gmail.com> * http://harbourminigui.googlepages.com/*/#include "minigui.ch" Function Main() Local nTra := 128, hWndDEFINE WINDOW WinTR ;AT 0,0 ;WIDTH 300 ;HEIGHT 300 ;TITLE 'Transparent window' ;MAIN ;NOSIZE NOMAXIMIZE ;ON INIT ( hWnd := GetFormHandle('WinTR'), SetTransparent(hWnd, nTra) )@ 200,100 BUTTON But1 ;CAPTION "Click Me" ;HEIGHT 35 WIDTH 100 ;ACTION ( nTra := IIF(nTra == 128, 255, 128), SetTransparent(hWnd, nTra) )END WINDOWCENTER WINDOW WinTRACTIVATE WINDOW WinTRRETURN NIL #pragma BEGINDUMP #include <windows.h>#include "hbapi.h"HB_FUNC( SETTRANSPARENT ){ typedef BOOL (__stdcall *PFN_SETLAYEREDWINDOWATTRIBUTES) (HWND, COLORREF, BYTE, DWORD);PFN_SETLAYEREDWINDOWATTRIBUTES pfnSetLayeredWindowAttributes = NULL;HINSTANCE hLib = LoadLibrary("user32.dll");if (hLib != NULL){pfnSetLayeredWindowAttributes = (PFN_SETLAYEREDWINDOWATTRIBUTES) GetProcAddress(hLib, "SetLayeredWindowAttributes");}if (pfnSetLayeredWindowAttributes){SetWindowLong((HWND) hb_parnl (1), GWL_EXSTYLE, GetWindowLong((HWND) hb_parnl (1), GWL_EXSTYLE) | WS_EX_LAYERED);pfnSetLayeredWindowAttributes((HWND) hb_parnl (1), 0, hb_parni (2), LWA_ALPHA);}if (!hLib){FreeLibrary(hLib);}} #pragma ENDDUMP
    8-)


    I need to develop an application that the window main would have to be transparent and be based on a png picture this is possible?
    It would be a window for game with the format of a picture png and all buttons on this images, would be next to the example: C: \ hmg.3.4.4 \ SAMPLES \ Miscellaneous \ ScreenSplash but with the main window with the possibility to create by ide
    jogo.png

    Statistics: Posted by jairpinho — Fri Aug 16, 2019 12:01 am


  5. Maybe this...

    \HMG\3.4.4\SAMPLES\Miscellaneous\ScreenSplash
    thank you, I found another post
    viewtopic.php?f=5&t=537&start=10

    Statistics: Posted by jairpinho — Thu Aug 15, 2019 11:58 pm