FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour @ SAY, @ GET COORDINATES
Posts: 3022
Joined: Fri Oct 07, 2005 01:45 PM
@ SAY, @ GET COORDINATES
Posted: Mon Oct 29, 2018 08: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
Posts: 1276
Joined: Tue Dec 28, 2010 01:29 PM
Re: @ SAY, @ GET COORDINATES
Posted: Mon Oct 29, 2018 09:02 PM

+1

FWH 25.12

Harbour/Hbmk2

Microsoft Visual C++

MySql 8.0

Antigravity

Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: @ SAY, @ GET COORDINATES
Posted: Mon Oct 29, 2018 09: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
Posts: 3022
Joined: Fri Oct 07, 2005 01:45 PM
Re: @ SAY, @ GET COORDINATES
Posted: 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
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: @ SAY, @ GET COORDINATES
Posted: 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

Posts: 3022
Joined: Fri Oct 07, 2005 01:45 PM
Re: @ SAY, @ GET COORDINATES
Posted: 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
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: @ SAY, @ GET COORDINATES
Posted: 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 (fw): Select all Collapse
ACTIVATE DIALOG oDlg;
         ON INIT CREATERIBBONBAR( oDlg );
         CENTER


Then, in the function CREATERIBBONBAR():

Code (fw): Select all Collapse
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
Posts: 3022
Joined: Fri Oct 07, 2005 01:45 PM
Re: @ SAY, @ GET COORDINATES
Posted: Tue Oct 30, 2018 03: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

Continue the discussion