to use xbrowse in dialog

to use xbrowse in dialog

Postby damianodec » Sun Jan 19, 2014 11:51 am

hallo,
I would like to use xbrowse in a dialog.
I have the dialog in myfile.dll creted with pelles C.
which "control" should I use?
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: 414
Joined: Wed Jun 06, 2007 2:58 pm
Location: Italia

Re: to use xbrowse in dialog

Postby cnavarro » Sun Jan 19, 2014 12:09 pm

Cristobal Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
User avatar
cnavarro
 
Posts: 6501
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: to use xbrowse in dialog

Postby damianodec » Sun Jan 19, 2014 10:46 pm

thanks for the reply,
I created with Pelles C myfile.dll and in myfile.dll I created dialog "PROVA"
i used custom control but when I choose custom control I had to type "txbrowse" (there were no classes to choose from).

this is the samples:
USE CUSTOMER NEW ALIAS (cAlias)
DEFINE FONT oFont NAME "Tahoma" SIZE 0, -12

DEFINE DIALOG odlg RESOURCE "PROVA" FONT oFont TITLE "TITOLO"
REDEFINE XBROWSE oBrw ID 200 SIZE -10,-30 PIXEL OF oDlg ;

WITH OBJECT oBrw
:nStretchCol := STRETCHCOL_WIDEST
:CreateFromCode()
END

ACTIVATE DIALOG ODLG

but when I run app.exe, fivewin return this error:
FiveWin Version: FWHX 11.12
Windows version: 6.1, Build 7601 Service Pack 1

Time from start: 0 hours 0 mins 0 secs
Error occurred at: 19-01-2014, 23:34:21
Error description: Error FiveWin/2 Duplicated Id: No: 101

any idea?
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: 414
Joined: Wed Jun 06, 2007 2:58 pm
Location: Italia

Re: to use xbrowse in dialog

Postby cnavarro » Sun Jan 19, 2014 10:48 pm

You can put here your. Rc?
Cristobal Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
User avatar
cnavarro
 
Posts: 6501
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: to use xbrowse in dialog

Postby damianodec » Sun Jan 19, 2014 11:12 pm

this is:
// RESOURCE SCRIPT generated by "Pelles C for Windows, version 7.00".

#include <windows.h>
#include <commctrl.h>
#include <richedit.h>

LANGUAGE LANG_ITALIAN,SUBLANG_ITALIAN

PROVA DIALOGEX FIXED IMPURE 6, 18, 310, 186
STYLE DS_SHELLFONT|WS_POPUP|DS_MODALFRAME|DS_CONTEXTHELP|DS_3DLOOK|WS_CAPTION|WS_SYSMENU|WS_VISIBLE
CAPTION "Dialog"
FONT 8, "Tahoma", 0, 0, 1
{
CONTROL "OK", IDOK, "Button", WS_TABSTOP, 160, 5, 45, 15
CONTROL "Cancel", IDCANCEL, "Button", WS_TABSTOP, 160, 23, 45, 15
CONTROL "This is a label:", 4001, "Static", WS_GROUP, 4, 20, 40, 8
CONTROL "", 200, "txbrowse", 0x00000000, 20, 60, 240, 92
}

LANGUAGE 0,0

DVCLAL RCDATA "res1.bin"
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: 414
Joined: Wed Jun 06, 2007 2:58 pm
Location: Italia

Re: to use xbrowse in dialog

Postby cnavarro » Sun Jan 19, 2014 11:33 pm

The problem is not in the. RC
You are calling the method CreateFromCode, and you have to call the method

:CreateFromResource( nId )
Cristobal Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
User avatar
cnavarro
 
Posts: 6501
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: to use xbrowse in dialog

Postby damianodec » Mon Jan 20, 2014 7:20 am

thanks mr. cnavarro,
Can you explain me the meaning of WITH OBJECT... ?
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: 414
Joined: Wed Jun 06, 2007 2:58 pm
Location: Italia

Re: to use xbrowse in dialog

Postby cnavarro » Mon Jan 20, 2014 8:18 am

To define the properties of an object and avoid putting on each object name <oBj>: data or <obj>: method

WITH OBJECT <oBj>

           : <data1>: = ...
           : <data2>: = ...
           : <data3>: = ...
           : <method> ()
END

equivalent to:

      <oBj>: <data1>: = ...
      <oBj>: <data2>: = ...
      <oBj>: <data3>: = ...
      <oBj>: <method> ()

I hope I explained
Cristobal Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
User avatar
cnavarro
 
Posts: 6501
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: to use xbrowse in dialog

Postby damianodec » Mon Jan 20, 2014 10:09 am

ok,
and now another question.
this is my code:
oDbf := oOdbc:Query( "SELECT articolo as codice, descrarticolo as descrizione, unitamisura as um, " +;
"prezzo as listino "+;
"FROM magazzino "+;
"WHERE codice = 'AAAA' "+;
"ORDER BY codice")
oDbf:Open()
oDbf:Gotop()

DEFINE FONT oFont NAME 'TAHOMA' SIZE 0,-12
DEFINE DIALOG odlg RESOURCE "PROVA" FONT oFont TITLE "TITOLO"

REDEFINE XBROWSE oBrw ID 200 OF oDlg

add to obrw data odbf:codice HEADER "Employees"

ACTIVATE DIALOG oDlg ;
CENTERED

....

odbc:query return 12 records but in xbrowse there is only the first record, why?
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: 414
Joined: Wed Jun 06, 2007 2:58 pm
Location: Italia

Re: to use xbrowse in dialog

Postby cnavarro » Mon Jan 20, 2014 10:41 am

Find this line in the example
.../...
REDEFINE XBROWSE .....

This example can perhaps help

viewtopic.php?f=3&t=27965#p156123
Cristobal Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
User avatar
cnavarro
 
Posts: 6501
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: to use xbrowse in dialog

Postby damianodec » Mon Jan 20, 2014 9:15 pm

thank you, it's very useful!

excuse me, I'm use: oOdbc := TOdbc():New( cDSN, cName, cPass ) and the example use DEFINE QUERY etc..., can you explain me what is the difference?
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: 414
Joined: Wed Jun 06, 2007 2:58 pm
Location: Italia

Re: to use xbrowse in dialog

Postby cnavarro » Mon Jan 20, 2014 9:22 pm

I think in the example they are using the class TDolphin using Mysql
In the forum there is a lot of information of that class and its Author: Daniel Garcia-Gil gives excellent help.
Cristobal Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
User avatar
cnavarro
 
Posts: 6501
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: to use xbrowse in dialog

Postby damianodec » Mon Jan 20, 2014 9:29 pm

Very good, thank you

Sent from my RM-885_eu_italy_299 using Tapatalk
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: 414
Joined: Wed Jun 06, 2007 2:58 pm
Location: Italia


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 28 guests