BTNBMP default button

BTNBMP default button

Postby damianodec » Tue May 24, 2022 1:59 pm

hi,
how can I assign DEFAULT to oBtnbmp BTNBMP inside a DIALOG ?

Code: Select all  Expand view  RUN

    DEFINE DIALOG oDlg SIZE 1300,700 PIXEL  FONT oFont
    STYLE nOR( DS_MODALFRAME, WS_POPUP, WS_CAPTION, WS_SYSMENU, ;
              WS_MAXIMIZEBOX, WS_MINIMIZEBOX, WS_THICKFRAME )
...
...
    @ 320,10 BTNBMP oBtnbmp SIZE 28,10 PIXEL OF oDlg RESOURCE "search" 2007
               TOOLTIP "OK" ;
                ACTION(doFunc())

    @ 320,70 BTNBMP oBtnbmp1 SIZE 28,10 PIXEL OF oDlg RESOURCE "search" 2007
               TOOLTIP "SEARCH" ;
                ACTION(doOther())
 


I would like that when I press ENTER start doFunc()

thanks
FiveWin for xHarbour 17.09 - Sep. 2017 - Embarcadero C++ 7.00 for Win32
FWH 64 for Harbour 19.06 (MSVC++) Jun. 2019 - Harbour 3.2.0dev (r1904111533)
Visual Studio 2019 - Pelles C V.8.00.60 (Win64)
User avatar
damianodec
 
Posts: 419
Joined: Wed Jun 06, 2007 2:58 pm
Location: Italia

Re: BTNBMP default button

Postby hmpaquito » Tue May 24, 2022 3:57 pm

Hi,

Code: Select all  Expand view  RUN

    DEFINE DIALOG oDlg SIZE 1300,700 PIXEL  FONT oFont
    STYLE nOR( DS_MODALFRAME, WS_POPUP, WS_CAPTION, WS_SYSMENU, ;
              WS_MAXIMIZEBOX, WS_MINIMIZEBOX, WS_THICKFRAME )

   oDlg:bInit:= {|| oBtnBmp:SetFocus() }      // <<<<<<<<<<<---------------------
...
...
    @ 320,10 BTNBMP oBtnbmp SIZE 28,10 PIXEL OF oDlg RESOURCE "search" 2007
               TOOLTIP "OK" ;
                ACTION(doFunc())

    @ 320,70 BTNBMP oBtnbmp1 SIZE 28,10 PIXEL OF oDlg RESOURCE "search" 2007
               TOOLTIP "SEARCH" ;
                ACTION(doOther())
 


Regards
hmpaquito
 
Posts: 1482
Joined: Thu Oct 30, 2008 2:37 pm

Re: BTNBMP default button

Postby damianodec » Wed May 25, 2022 7:26 am

hi
thank you, into dialog there are a lot of get and button and I would like that when I press RETURN inside any GET or button start ACTION(doFunc())
FiveWin for xHarbour 17.09 - Sep. 2017 - Embarcadero C++ 7.00 for Win32
FWH 64 for Harbour 19.06 (MSVC++) Jun. 2019 - Harbour 3.2.0dev (r1904111533)
Visual Studio 2019 - Pelles C V.8.00.60 (Win64)
User avatar
damianodec
 
Posts: 419
Joined: Wed Jun 06, 2007 2:58 pm
Location: Italia

Re: BTNBMP default button

Postby damianodec » Thu May 26, 2022 6:19 am

Hi,
no solution?
inside Fivewin.ch BUTTON, BUTTONBMP AND FLATBTN have DEFAULT option but BTNBPM no, is there any update, how can I to solve it?
thank you
FiveWin for xHarbour 17.09 - Sep. 2017 - Embarcadero C++ 7.00 for Win32
FWH 64 for Harbour 19.06 (MSVC++) Jun. 2019 - Harbour 3.2.0dev (r1904111533)
Visual Studio 2019 - Pelles C V.8.00.60 (Win64)
User avatar
damianodec
 
Posts: 419
Joined: Wed Jun 06, 2007 2:58 pm
Location: Italia

Re: BTNBMP default button

Postby Antonio Linares » Thu May 26, 2022 9:13 am

Damiano,

Try this:

#define BM_SETSTYLE 244

oDlg:bInit := { || oBtnBmp:SendMsg( BM_SETSTYLE, BS_DEFPUSHBUTTON, 1 ) }

or

oDlg:bInit := { || oBtnBmp:PostMsg( BM_SETSTYLE, BS_DEFPUSHBUTTON, 1 ) }
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42122
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: BTNBMP default button

Postby damianodec » Thu May 26, 2022 10:36 am

hi Antonio,
it doesn't work in any way.
Return key go on to the next GET field but not active BTNBMP

in others PGM I use REDEFINE DIALOG from resource and it works because obtnbmp has ID = IDOK (I use Pelles C) but in this case I don't want to use REDEFINE.
FiveWin for xHarbour 17.09 - Sep. 2017 - Embarcadero C++ 7.00 for Win32
FWH 64 for Harbour 19.06 (MSVC++) Jun. 2019 - Harbour 3.2.0dev (r1904111533)
Visual Studio 2019 - Pelles C V.8.00.60 (Win64)
User avatar
damianodec
 
Posts: 419
Joined: Wed Jun 06, 2007 2:58 pm
Location: Italia

Re: BTNBMP default button

Postby Antonio Linares » Thu May 26, 2022 11:40 am

Dear Damiano,

Could you post a small example complete to test here ?

many thanks
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42122
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: BTNBMP default button

Postby damianodec » Thu May 26, 2022 2:43 pm

hi Antonio,
Code: Select all  Expand view  RUN

local m_get[70]
local o_get[70]
local oFont, oFontU

DEFINE FONT oFont NAME "Tahoma" SIZE 0, -12
DEFINE FONT oFontU NAME "Tahoma" SIZE 0, -12 UNDERLINE

DEFINE DIALOG m_get[32] SIZE 1300,700 PIXEL  FONT oFont;
STYLE nOR( DS_MODALFRAME, WS_POPUP, WS_CAPTION, WS_SYSMENU, ;
          WS_MAXIMIZEBOX, WS_MINIMIZEBOX, WS_THICKFRAME )
          TITLE "Interrogazione distinta base"

    @ 10, 30 GET o_get[04] VAR m_get[04] SIZE 10, 10 PIXEL OF m_get[32] NOBORDER PICTURE "@ !" 

    @ 10, 45 SAY oSay PROMPT "Tipo Interrogazione" SIZE 65, 10 PIXEL OF m_get[32]
    @ 20, 45 SAY oSay PROMPT "ESPLOSIONE" SIZE 65, 10 PIXEL OF m_get[32]    FONT oFontU
    @ 28, 45 SAY oSay PROMPT "1 - a singolo livello" SIZE 65, 10 PIXEL OF m_get[32] 
    @ 36, 45 SAY oSay PROMPT "2 - scalare" SIZE 65, 10 PIXEL OF m_get[32]   
    @ 44, 45 SAY oSay PROMPT "4 - ai materiali di base" SIZE 65, 10 PIXEL OF m_get[32] 

    @ 20, 120 SAY oSay PROMPT "IMPLOSIONE" SIZE 65, 10 PIXEL OF m_get[32] FONT oFontU          
    @ 28, 120 SAY oSay PROMPT "5 - a singolo livello" SIZE 65, 10 PIXEL OF m_get[32]   
    @ 36, 120 SAY oSay PROMPT "6 - scalare" SIZE 65, 10 PIXEL OF m_get[32] 
    @ 44, 120 SAY oSay PROMPT "8 - ai prodotti finiti" SIZE 65, 10 PIXEL OF m_get[32]      

    @ 10, 210 SAY oSay PROMPT "Articolo" SIZE 40, 10 PIXEL OF m_get[32] 
    @ 10, 243 GET o_get[01] VAR m_get[01] PICTURE "@!!!!!!!!!!!!!!!" SIZE 55, 10 OF m_get[32] NOBORDER pixel ;
        VALID (msginfo("VALID"))
   
    @ 10, 305 GET o_get[02] VAR m_get[02] SIZE 150, 10 PIXEL OF m_get[32] NOBORDER COLOR  ;
    PICTURE "@ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"  

    @ 23, 210 SAY oSay PROMPT hb_OemToAnsi( hb_utf8tostr("Validità")) SIZE 40, 10 PIXEL OF m_get[32]   
    @ 23, 243 GET o_get[03] VAR m_get[03] SIZE 50, 10 PIXEL OF m_get[32] NOBORDER COLOR  ;
    PICTURE "@   /  /    "
   
    @ 23, 305 SAY o_get[06] VAR m_get[06] SIZE 150, 10 PIXEL OF m_get[32]

    @ 36, 210 SAY oSay PROMPT hb_OemToAnsi( hb_utf8tostr("Quantità")) SIZE 40, 10 PIXEL OF m_get[32]      
    @ 36, 243 GET o_get[05] VAR m_get[05] SIZE 50, 10 PIXEL OF m_get[32] NOBORDER RIGHT  ;
    PICTURE "@ZE 99999.999999" 

    @ 63,10 XBROWSE oBrw SIZE -10,-45 PIXEL ;
    RECORDSET M_GET[21] /* AdoDb object */;
    COLUMNS "LIVELLO" ;
    COLSIZES 70  ;
    HEADERS  "LIV." ;
    PICTURE "@ !!!!!!!!!!!!!!" ;
    OF m_get[32] LINES NOBORDER ;
    ON DBLCLICK(msginfo("dblclick"))   

    oBrw:CreateFromCode()
   
    WITH OBJECT oBrw
        :GoTop()
    :lHScroll            := .T.
        :lVScroll            := .T.
        :lRecordSelector     := .t.
        :nColDividerStyle    := LINESTYLE_BLACK
        :nRowDividerStyle    := LINESTYLE_BLACK
        :lColDividerComplete := .T.
        :bClrSelFocus = { || { 16777215, 15512898 } }  
        :bClrSel = { || { 16777215, 15512898 } }

    END    

    @ 10,460 BTNBMP o_get[51] SIZE 28,10 PIXEL OF m_get[32] RESOURCE "search" 2007          ;
    ACTION (msginfo("find"))

    @ 320,10 BTNBMP o_get[61] SIZE 50,20 OF m_get[32] RESOURCE "ok" 2007        ;
    TOOLTIP "CONFERMA" ;
    ACTION (msginfo("ok"))  

    @ 320,70 BTNBMP o_get[62] SIZE 50,20 OF m_get[32] RESOURCE "chiudi"  2007         ;
    TOOLTIP "ESCI" ;
    ACTION (msginfo("exit"))
   
    @ 320,130 BTNBMP o_get[63] SIZE 50,20 OF m_get[32] RESOURCE "excel"  2007         ;
    TOOLTIP "Esporta in"+CRLF+"Excel" ;
    ACTION (msginfo("excel"))   

    if ExcelObj() == NIL
        o_get[63]:Disable()
    endif
   
    m_get[32]:bResized := { || ;
    oRect           := m_get[32]:GetCliRect(), ;
    o_get[61]:nTop  := oRect:nBottom  -60, ;
    o_get[61]:nLeft := oRect:nLeft   +10, ;
    o_get[62]:nTop  := oRect:nBottom  -60, ;
    o_get[62]:nLeft := oRect:nLeft   +135, ;
    o_get[63]:nTop  := oRect:nBottom  -60, ;
    o_get[63]:nLeft := oRect:nLeft   +260 ;        
    }

ACTIVATE DIALOG m_get[32] ;
    CENTERED
 
FiveWin for xHarbour 17.09 - Sep. 2017 - Embarcadero C++ 7.00 for Win32
FWH 64 for Harbour 19.06 (MSVC++) Jun. 2019 - Harbour 3.2.0dev (r1904111533)
Visual Studio 2019 - Pelles C V.8.00.60 (Win64)
User avatar
damianodec
 
Posts: 419
Joined: Wed Jun 06, 2007 2:58 pm
Location: Italia

Re: BTNBMP default button

Postby nageswaragunupudi » Thu May 26, 2022 8:58 pm

damianodec wrote:hi,
how can I assign DEFAULT to oBtnbmp BTNBMP inside a DIALOG ?

Code: Select all  Expand view  RUN

    DEFINE DIALOG oDlg SIZE 1300,700 PIXEL  FONT oFont
    STYLE nOR( DS_MODALFRAME, WS_POPUP, WS_CAPTION, WS_SYSMENU, ;
              WS_MAXIMIZEBOX, WS_MINIMIZEBOX, WS_THICKFRAME )
...
...
    @ 320,10 BTNBMP oBtnbmp SIZE 28,10 PIXEL OF oDlg RESOURCE "search" 2007
               TOOLTIP "OK" ;
                ACTION(doFunc())

    @ 320,70 BTNBMP oBtnbmp1 SIZE 28,10 PIXEL OF oDlg RESOURCE "search" 2007
               TOOLTIP "SEARCH" ;
                ACTION(doOther())
 


I would like that when I press ENTER start doFunc()

thanks


Please add the line:
Code: Select all  Expand view  RUN
oBtnBmp:nID := 1

after creating the button.
Like this:
Code: Select all  Expand view  RUN

   DEFINE DIALOG oDlg SIZE 1300,700 PIXEL  FONT oFont
    STYLE nOR( DS_MODALFRAME, WS_POPUP, WS_CAPTION, WS_SYSMENU, ;
              WS_MAXIMIZEBOX, WS_MINIMIZEBOX, WS_THICKFRAME )
...
...
    @ 320,10 BTNBMP oBtnbmp SIZE 28,10 PIXEL OF oDlg RESOURCE "search" 2007
               TOOLTIP "OK" ;
                ACTION(doFunc())

   oBtnBmp:nId := 1  // New: Insert this here to make oBtnBmp as DEFAULT
 
 
    @ 320,70 BTNBMP oBtnbmp1 SIZE 28,10 PIXEL OF oDlg RESOURCE "search" 2007
               TOOLTIP "SEARCH" ;
                ACTION(doOther())
 
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10646
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: BTNBMP default button

Postby damianodec » Tue May 31, 2022 7:23 am

hi Mr. Rao, it works, thank you!
FiveWin for xHarbour 17.09 - Sep. 2017 - Embarcadero C++ 7.00 for Win32
FWH 64 for Harbour 19.06 (MSVC++) Jun. 2019 - Harbour 3.2.0dev (r1904111533)
Visual Studio 2019 - Pelles C V.8.00.60 (Win64)
User avatar
damianodec
 
Posts: 419
Joined: Wed Jun 06, 2007 2:58 pm
Location: Italia


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 38 guests