@ SAY, @ GET COORDINATES

@ SAY, @ GET COORDINATES

Postby TimStone » Mon Oct 29, 2018 8:51 pm

I am trying to convert .RC dialogs to .PRG windows. I have always used resources in the past, and have very nicely designed, but complex, screens.

I am converting because 1) I want to use a Ribbon Bar that only seems to work with the @ x,y coordinates and is not friendly to resource dialogs, and 2) All examples now seem to be using @ x,y formats.

I have been looking for a way to calculate the correct x,y values based on the settings in the .rc. file. I have not been able to figure out any consistent formula that works.

There is a sample RC2PRG.prg program, and it does a nice job, but the coordinates are not even close to being accurate. The controls all overlap significantly. I don't know if anyone has used this before and perhaps has a multiplier or correction to adapt to today's monitors.

Any guidance on this would be greatly appreciated. I asked about calculating the @ x,y coordinates in the past with no success. I hope this time will be different.
Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
User avatar
TimStone
 
Posts: 2944
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA

Re: @ SAY, @ GET COORDINATES

Postby Compuin » Mon Oct 29, 2018 9:02 pm

+1
FWH 20.12
Hbmk2 32/64 Bits (Build 19.29.30133)
Microsoft Visual C 32 Bits
MySql 8.0.24 32/64 Bits
VS Code
Compuin
 
Posts: 1214
Joined: Tue Dec 28, 2010 1:29 pm
Location: Quebec, Canada

Re: @ SAY, @ GET COORDINATES

Postby Enrico Maria Giordano » Mon Oct 29, 2018 9:56 pm

TimStone wrote:I am trying to convert .RC dialogs to .PRG windows. I have always used resources in the past, and have very nicely designed, but complex, screens.

I am converting because 1) I want to use a Ribbon Bar that only seems to work with the @ x,y coordinates and is not friendly to resource dialogs,


If this is the reason please stop. You can use ribbon bar with resources too. There is no problem in doing that.

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8710
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: @ SAY, @ GET COORDINATES

Postby TimStone » Mon Oct 29, 2018 10:19 pm

How ? I tried and it failed ? I asked for a sample here and no one answered.
Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
User avatar
TimStone
 
Posts: 2944
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA

Re: @ SAY, @ GET COORDINATES

Postby Enrico Maria Giordano » Mon Oct 29, 2018 10:28 pm

You only need to create the ribbon bar in the ON INIT clause of the ACTIVATE DIALOG command.

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8710
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: @ SAY, @ GET COORDINATES

Postby TimStone » Mon Oct 29, 2018 10:38 pm

Right now I have a CLASS, and a METHOD is used to provide a full edit capability. I use a button bar, and all of the code is in that method.

Are you saying to extract the button bar code, and create a FUNCTION or METHOD to create a Ribbon Bar for the ON INIT ?

I sure wish this had documentation, or Samples ... but of course we don't have any.
Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
User avatar
TimStone
 
Posts: 2944
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA

Re: @ SAY, @ GET COORDINATES

Postby Enrico Maria Giordano » Mon Oct 29, 2018 11:02 pm

Please search the FWH dir for *.prg files containing the word RIBBON and you will find many samples.

Anyway, the technique is very simple:

Code: Select all  Expand view
ACTIVATE DIALOG oDlg;
         ON INIT CREATERIBBONBAR( oDlg );
         CENTER


Then, in the function CREATERIBBONBAR():

Code: Select all  Expand view
STATIC FUNCTION CREATERIBBONBAR( oDlg )

    LOCAL oRib, oGrp

    DEFINE RIBBONBAR oRib OF oDlg …

    oDlg:oBar = oRib

    ADD GROUP oGrp RIBBONBAR oRib ...

    @ 2, 2 ADD BUTTON GROUP oGrp …

    ...

    RETURN NIL


EMG
User avatar
Enrico Maria Giordano
 
Posts: 8710
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: @ SAY, @ GET COORDINATES

Postby TimStone » Tue Oct 30, 2018 3:51 pm

Thank you.

I first worked with some stand alone samples and they were ok. However, when I went in to do it within the program, I got very strange results. I will spend some more time, but I think the problem may be that I am addressing a Method within a class that displays a complex DIALOG, and then trying to overlay it with a button bar using @ x,y commands. I used to call button bars the way you suggest, so I am familiar with the concept. ( Now my button bars are embedded within the full method, ever since Button Bars were modified to use within a resource with a tbar object ).

I also noted that this approach slows down the loading of the screen significantly ...

Tim
Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
User avatar
TimStone
 
Posts: 2944
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 41 guests