Button

Creative ideas/suggestions for HMG

Moderator: Rathinagiri

User avatar
serge_girard
Posts: 3166
Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB
2 DBF
Location: Belgium
Contact:

Button

Post by serge_girard »

Could we have standard picture buttons for Save, Cancel, Print,... ?

Serge
There's nothing you can do that can't be done...
User avatar
srvet_claudio
Posts: 2193
Joined: Thu Feb 25, 2010 8:43 pm
Location: Uruguay
Contact:

Re: Button

Post by srvet_claudio »

As standard HMG resources that you can call using an id?
Best regards.
Dr. Claudio Soto
(from Uruguay)
http://srvet.blogspot.com
User avatar
serge_girard
Posts: 3166
Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB
2 DBF
Location: Belgium
Contact:

Re: Button

Post by serge_girard »

Maybe, if possible.

Manytimes I need a SAVE button, a PRINT button,... then I copy some pictures from another project ... etc.
Maybe a new control?
Would be nice to have!
Serge
There's nothing you can do that can't be done...
User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil

Button

Post by Pablo César »

Serge, please compile this and see if it would be useful for you:

Code: Select all

/*  Embbeded pictures from HMG resource file.

    Read at ..\RESOURCES\hmg32.rc             
    
    Icons too and any other file being at .rc files
*/

#include <hmg.ch>

Function Main()
SET DEFAULT ICON TO "ZZZ_LED_OFF" // To set for InputBox / 

DEFINE WINDOW Demo AT 254, 369 WIDTH 539 HEIGHT 443 BACKCOLOR {0,162,232} ;
    TITLE "Standard pictures for buttons (HMG Resource)" ICON "_DBGICON" MAIN

    DEFINE BUTTON Button_1
        ROW    40
        COL    60
        WIDTH  50
        HEIGHT 70
        ACTION InputWindow_Click()
        CAPTION "Print"
        TRANSPARENT .T.
        TOOLTIP '"HP_PRINT"'
        PICTURE "HP_PRINT"
        PICTALIGNMENT TOP
    END BUTTON

    DEFINE BUTTON Button_2
        ROW    40
        COL    120
        WIDTH  50
        HEIGHT 70
        ACTION InputBox("Name: ","")
        CAPTION "Save"
        TRANSPARENT .T.
        TOOLTIP '"HP_SAVE"'
        PICTURE "HP_SAVE"
        PICTALIGNMENT TOP
    END BUTTON

    DEFINE BUTTON Button_3
        ROW    40
        COL    180
        WIDTH  50
        HEIGHT 70
        ACTION Nil
        CAPTION "Exit"
        TRANSPARENT .T.
        TOOLTIP '"HP_CLOSE"'
        PICTURE "HP_CLOSE"
        PICTALIGNMENT TOP
    END BUTTON

    DEFINE BUTTON Button_4
        ROW    40
        COL    240
        WIDTH  50
        HEIGHT 70
        ACTION Nil
        CAPTION "Close"
        TRANSPARENT .T.
        TOOLTIP '"HMG_EDIT_CLOSE"'
        PICTURE "HMG_EDIT_CLOSE"
        PICTALIGNMENT TOP
    END BUTTON

    DEFINE BUTTON Button_5
        ROW    40
        COL    300
        WIDTH  50
        HEIGHT 70
        ACTION Nil
        CAPTION "New"
        TRANSPARENT .T.
        TOOLTIP '"HMG_EDIT_NEW"'
        PICTURE "HMG_EDIT_NEW"
        PICTALIGNMENT TOP
    END BUTTON

    DEFINE BUTTON Button_6
        ROW    40
        COL    360
        WIDTH  50
        HEIGHT 70
        ACTION Nil
        CAPTION "Cancel"
        TRANSPARENT .T.
        TOOLTIP '"HMG_EDIT_CANCEL"'
        PICTURE "HMG_EDIT_CANCEL"
        PICTALIGNMENT TOP
    END BUTTON

    DEFINE BUTTON Button_7
        ROW    40
        COL    420
        WIDTH  50
        HEIGHT 70
        ACTION Nil
        CAPTION "Edit"
        TRANSPARENT .T.
        TOOLTIP '"HMG_EDIT_EDIT"'
        PICTURE "HMG_EDIT_EDIT"
        PICTALIGNMENT TOP
    END BUTTON

    DEFINE BUTTON Button_8
        ROW    120
        COL    60
        WIDTH  50
        HEIGHT 70
        ACTION Nil
        CAPTION "Next"
        TRANSPARENT .T.
        TOOLTIP '"HP_NEXT"'
        PICTURE "HP_NEXT"
        PICTALIGNMENT TOP
    END BUTTON

    DEFINE BUTTON Button_9
        ROW    120
        COL    120
        WIDTH  50
        HEIGHT 70
        ACTION Nil
        CAPTION "Back"
        TRANSPARENT .T.
        TOOLTIP '"HP_BACK"'
        PICTURE "HP_BACK"
        PICTALIGNMENT TOP
    END BUTTON

    DEFINE BUTTON Button_10
        ROW    120
        COL    180
        WIDTH  50
        HEIGHT 70
        ACTION Nil
        CAPTION "Top"
        TRANSPARENT .T.
        TOOLTIP '"HP_TOP"'
        PICTURE "HP_TOP"
        PICTALIGNMENT TOP
    END BUTTON

    DEFINE BUTTON Button_11
        ROW    120
        COL    240
        WIDTH  50
        HEIGHT 70
        ACTION Nil
        CAPTION "Bottom"
        TRANSPARENT .T.
        TOOLTIP '"HP_END"'
        PICTURE "HP_END"
        PICTALIGNMENT TOP
    END BUTTON

    DEFINE BUTTON Button_12
        ROW    120
        COL    300
        WIDTH  50
        HEIGHT 70
        ACTION Nil
        CAPTION "Go To"
        TRANSPARENT .T.
        TOOLTIP '"HP_GOPAGE"'
        PICTURE "HP_GOPAGE"
        PICTALIGNMENT TOP
    END BUTTON

    DEFINE BUTTON Button_13
        ROW    120
        COL    360
        WIDTH  50
        HEIGHT 70
        ACTION Nil
        CAPTION "Right"
        TRANSPARENT .T.
        TOOLTIP '"HMG_EDIT_ADD"'
        PICTURE "HMG_EDIT_ADD"
        PICTALIGNMENT TOP
    END BUTTON

    DEFINE BUTTON Button_14
        ROW    120
        COL    420
        WIDTH  50
        HEIGHT 70
        ACTION Nil
        CAPTION "Left"
        TRANSPARENT .T.
        TOOLTIP '"HMG_EDIT_DEL"'
        PICTURE "HMG_EDIT_DEL"
        PICTALIGNMENT TOP
    END BUTTON

    DEFINE BUTTON Button_15
        ROW    200
        COL    60
        WIDTH  50
        HEIGHT 70
        ACTION Nil
        CAPTION "Ok"
        TRANSPARENT .T.
        TOOLTIP '"HMG_EDIT_OK"'
        PICTURE "HMG_EDIT_OK"
        PICTALIGNMENT TOP
    END BUTTON

    DEFINE BUTTON Button_16
        ROW    200
        COL    120
        WIDTH  50
        HEIGHT 70
        ACTION Nil
        CAPTION "Delete"
        TRANSPARENT .T.
        TOOLTIP '"HMG_EDIT_DELETE"'
        PICTURE "HMG_EDIT_DELETE"
        PICTALIGNMENT TOP
    END BUTTON

    DEFINE BUTTON Button_17
        ROW    200
        COL    180
        WIDTH  50
        HEIGHT 70
        ACTION Nil
        CAPTION "Copy"
        TRANSPARENT .T.
        TOOLTIP '"HMG_EDIT_COPY"'
        PICTURE "HMG_EDIT_COPY"
        PICTALIGNMENT TOP
    END BUTTON

    DEFINE BUTTON Button_18
        ROW    200
        COL    240
        WIDTH  50
        HEIGHT 70
        ACTION Nil
        CAPTION "Search"
        TRANSPARENT .T.
        TOOLTIP '"HMG_EDIT_FIND"'
        PICTURE "HMG_EDIT_FIND"
        PICTALIGNMENT TOP
    END BUTTON

    DEFINE BUTTON Button_19
        ROW    200
        COL    300
        WIDTH  50
        HEIGHT 70
        ACTION Nil
        CAPTION "Folder"
        TRANSPARENT .T.
        TOOLTIP '"HP_FOLDER"'
        PICTURE "HP_FOLDER"
        PICTALIGNMENT TOP
    END BUTTON

    DEFINE BUTTON Button_20
        ROW    200
        COL    360
        WIDTH  50
        HEIGHT 70
        ACTION Nil
        CAPTION "Print"
        TRANSPARENT .T.
        TOOLTIP '"HMG_EDIT_PRINT"'
        PICTURE "HMG_EDIT_PRINT"
        PICTALIGNMENT TOP
    END BUTTON

    DEFINE BUTTON Button_21
        ROW    200
        COL    420
        WIDTH  50
        HEIGHT 70
        ACTION Nil
        CAPTION "Zoom"
        TRANSPARENT .T.
        TOOLTIP '"HP_ZOOM"'
        PICTURE "HP_ZOOM"
        PICTALIGNMENT TOP
    END BUTTON
    
    DEFINE BUTTON Button_22
        ROW    280
        COL    60
        WIDTH  50
        HEIGHT 70
        ACTION Nil
        CAPTION "Play"
        TRANSPARENT .T.
        TOOLTIP '"HMG_EDIT_SET"'
        PICTURE "HMG_EDIT_SET"
        PICTALIGNMENT TOP
    END BUTTON

    DEFINE BUTTON Button_23
        ROW    280
        COL    120
        WIDTH  50
        HEIGHT 70
        ACTION Nil
        CAPTION "Cancel"
        TRANSPARENT .T.
        TOOLTIP '"GRID_MCAN"'
        PICTURE "GRID_MCAN"
        PICTALIGNMENT TOP
    END BUTTON

    DEFINE BUTTON Button_24
        ROW    280
        COL    180
        WIDTH  50
        HEIGHT 70
        ACTION Nil
        CAPTION "Save"
        TRANSPARENT .T.
        TOOLTIP '"GRID_MSAV"'
        PICTURE "GRID_MSAV"
        PICTALIGNMENT TOP
    END BUTTON

    DEFINE BUTTON Button_25
        ROW    280
        COL    240
        WIDTH  50
        HEIGHT 70
        ACTION Nil
        CAPTION "Pointer"
        TRANSPARENT .T.
        TOOLTIP '"_pointer"'
        PICTURE "_pointer"
        PICTALIGNMENT TOP
    END BUTTON

    DEFINE BUTTON Button_26
        ROW    280
        COL    300
        WIDTH  50
        HEIGHT 70
        ACTION Nil
        CAPTION "Open"
        TRANSPARENT .T.
        TOOLTIP '"_open"'
        PICTURE "_open"
        PICTALIGNMENT TOP
    END BUTTON

    DEFINE BUTTON Button_27
        ROW    280
        COL    360
        WIDTH  50
        HEIGHT 70
        ACTION Nil
        CAPTION "Refresh"
        TRANSPARENT .T.
        TOOLTIP '"_refresh"'
        PICTURE "_refresh"
        PICTALIGNMENT TOP
    END BUTTON

    DEFINE BUTTON Button_28
        ROW    280
        COL    420
        WIDTH  50
        HEIGHT 70
        ACTION Nil
        CAPTION "T.Nail"
        TRANSPARENT .T.
        TOOLTIP '"hp_thumbnail"'
        PICTURE "hp_thumbnail"
        PICTALIGNMENT TOP
    END BUTTON

END WINDOW
Demo.Center
Demo.Activate
Return Nil

Function InputWindow_Click()
LOCAL Title , aLabels , aInitValues , aFormats , aResults 

Title       := 'InputWindow Test'
aLabels     := { 'Field 1:' , 'Field 2:', 'Field 3:', 'Field 4:', 'Field 5:', 'Field 6:' }
aInitValues := { 'Init Text', .t. , 2, Date(), 12.34,'Init text' }
aFormats    := { 20, Nil, {'Option 1','Option 2'}, Nil, '99.99', 50 }
aResults    := InputWindow ( Title , aLabels , aInitValues , aFormats )
Return Nil
 
Screen94.png
Screen94.png (75.96 KiB) Viewed 5468 times
 
Please note icons at main, InputBox and InputWindow. ToolTips and code showing it names in HMG resource too.
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
User avatar
serge_girard
Posts: 3166
Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB
2 DBF
Location: Belgium
Contact:

Re: Button

Post by serge_girard »

Great Pablo, really ! I didn't know about these!
Thanks !
Serge
There's nothing you can do that can't be done...
User avatar
dragancesu
Posts: 921
Joined: Mon Jun 24, 2013 11:53 am
DBs Used: DBF, MySQL, Oracle
Location: Subotica, Serbia

Re: Button

Post by dragancesu »

Serge is a professional developer and wrote what passion and others, many development tools have a set of icons on the application, I think it deserves and HMG

IMHO, should be 2 or 3 sets of icons, size 32x32/24x24, colored/BW, perhaps in blue, green, brown tones (I prefer blue)

I wrote in old message

http://hmgforum.com/viewtopic.php?f=11&t=4216
User avatar
mol
Posts: 3720
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Contact:

Re: Button

Post by mol »

dragancesu wrote: Wed Feb 22, 2017 7:32 am
IMHO, should be 2 or 3 sets of icons, size 32x32/24x24, colored/BW, perhaps in blue, green, brown tones (I prefer blue)

I wrote in old message

http://hmgforum.com/viewtopic.php?f=11&t=4216
It's fine idea, but icons should be modern than these presented, but it's only my humble opinion
User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil

RESOURCES - RC files

Post by Pablo César »

I take this opportunity to return to share knowledge with you on this subject that is important to me.

In my opinion, the use of images embedded in a system is good practice but it all depends on the standardization and taste that each developer has.

We would stand here presenting a lot of images and would never be good enough for everyone.

It is correct to make the size differentiation of the images is very important. For the image to have a better quality in details and settings will always depend on the size. The bigger the richer the details, then more definition.

I still think that even though HMG offers this feature of embedding the images is good but very limited in Windows because it can not handle paths with spaces. WindRes.exe is an external third-party application (in this case at https://bugzilla.readthedocs.io/en/5.0/ ... ml#credits).
GNU windres (GNU Binutils) 2.25
Copyright (C) 2014 Free Software Foundation, Inc.
This program is free software; You can redistribute it under the terms of
The GNU General Public License version 3 or (at your option) any later version.
This program has absolutely no warranty.
And it is because of it that the HMG needs to be installed in folder that do not contain spaces. I wrote about it here: viewtopic.php?p=49337#p49337

The solution I see possible to circumvent this bug they have not yet found a solution. It would move the RESOURCES folder out of the HMG package where it was installed. Leaving it at the root of the disk. So developers could make use of the same folder by concentrating their favorite and standardized images.
With this we could get rid of the imposition of not putting special characters.
 
Image
 
Special characters for the blanks? :? :x :?:
This in Windows is totally common.

File names argument MUST be surrounded by "" (quotes embraced) is very used and the operating system accepts as well as the Harbour and the MiniGW compiler as well.
 
Googled
Aproveito a ocasião, para voltar a compatilhar conhecimento com vocês para este assunto que para mim é importante.

Na minha opinião, o uso de imagens embutidas em um sistema é uma boa prática mas tudo depende da padronização e gosto que cada developer tem.

Ficariamos aqui apresentando um monte de imagens e nunca estaria o suficiente bom para todos.

Está correto fazer a diferenciação de tamanhos das imagens é muito importante. Pois para que a imagem tenha uma qualidade melhor em detalhes e definições dependerá muito sempre do tamanho. Quanto maior mais rico em detalhes, mais definição.

Eu ainda acho que mesmo que a HMG ofereça esse recurso de embutir as imagens é bom mas muito limitado em Windows, porque ele não pode manipular caminhos com espaços. O WindRes.exe é um aplicativo externo de terceiros (neste caso a https://bugzilla.readthedocs.io/en/5.0/ ... ml#credits).
GNU windres (GNU Binutils) 2.25
Copyright (C) 2014 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or (at your option) any later version.
This program has absolutely no warranty.
E é por causa dele que o HMG precisa estar instalado em pasta que não contenham espaços. Eu escrevi a respeito disso aqui: viewtopic.php?p=49337#p49337

A solução que eu vejo possível para contornar este bug que ainda não encontraram solução. Seria mover a pasta RESOURCES para fora do pacote HMG onde foi instalado. Deixando na raiz do disco, por exemplo. Então os desenvolvedores poderiam fazer uso da mesma pasta concentrando as suas imagens favoritas e padronizadas.
Com isto conseguiríamos ver-nos livre da imposição de não colocar caracteres especiais.
 
Image
 
Caracteres especiais para o espaços em branco ? :? :x :?:
Isto em Windows é totalmente comum.

Argumento de nomes de arquivos DEVE ser cercado por "" é muito utilizado e o sistema operacional aceita assim como o Harbour e o compilado MiniGW também.
 
Googled
Quiero aprovechar esta oportunidad para volver a compartir conocimiento con ustedes sobre este tema que es importante para mí.

En mi opinión, el uso de imágenes incrustadas en un sistema es una buena práctica, pero todo depende de la padronización y gusto de cada desarrollador tiene.

Estaríamos aquí presentando una gran cantidad de imágenes y nunca seria lo bueno suficientemente para todos.

Estoy de acuerdo en diferenciar las imágenes por tamaño, lo veo muy importante. Porque de esta manera la imagenes tienen mejor calidad de resolución y detalles cuando más tamaño tiene mejor es. Cuanto mayor sea más rica en detalle, más ajustes tiene.

Pienso aún que la inclusión de HMG de incrustar las imágenes es buena, pero muy limitado en Windows, ya que no puede controlar paths con espacios. El WindRes.exe es una aplicación externa de terceros (en este caso hurl]https://bugzilla.readthedocs.io/en/5.0/ ... ml#credits[/url]).
Windres GNU (GNU Binutils) 2:25
Copyright (C) 2014 Free Software Foundation, Inc.
Este programa es software libre; puede redistribuirlo bajo los términos de
la versión de GNU Licencia Pública General 3 o (a su elección) cualquier versión posterior.
Este programa no tiene absolutamente la garantía.
Y es gracias a él que el inhibidor de que HMG debe estar instalado en la carpeta que no contenga espacios. Escribí sobre ello aquí: viewtopic.php?p=49337#p49337

La única solución que veo posible, a fin de evitar este error y que no han encontrado solución. Seria en mover la carpeta de recursos RESOURCES del paquete de la HMG donde se instaló. Dejando la en la raíz del disco. Y asi tambien, los desarrolladores pueden hacer uso de la misma carpeta centrando todas sus imágenes favoritas y estandarizada en un mismo lugar.
Con esto podríamos vernos libres del mensaje de error del IDE para no colocar caracteres especiales.
 
Image
 
Caracteres especiales los espacios en blanco ? :? :x :?:

Esto es bastante común en Windows. Los nombres de archivos como argumentos deben estar rodeados de "" es ampliamente utilizado y el sistema operativo es compatible, así como Harbour y el compilador MiniGW también.
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil

Button images => RESOURCES = RC files

Post by Pablo César »

Sorry to have translated into 3 languages ... (I think I exaggerated) but I hope everyone will read and if possible we can find a solution. Because I've been promoting this for years. It would even seem that with HMG we are not allied with Windows ...
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
User avatar
serge_girard
Posts: 3166
Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB
2 DBF
Location: Belgium
Contact:

Re: Button

Post by serge_girard »

THX ! Pablo, I think your button dmeo should be included in the DOCS + samples

Serge
There's nothing you can do that can't be done...
Post Reply