using REDEFINE and *.RC under HMG

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

Post Reply
User avatar
AUGE_OHR
Posts: 2093
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany

using REDEFINE and *.RC under HMG

Post by AUGE_OHR »

hi,

under Fivewin i found a lot of *.PRG that look like this

Code: Select all

  DEFINE DIALOG oDlg RESOURCE "MsgDates" TITLE OemToAnsi(Titulo)

    REDEFINE GET oFec1 VAR Fec1 ID 101 OF oDlg PICTURE "@D"
    REDEFINE GET oFec2 VAR Fec2 ID 102 OF oDlg PICTURE "@D"

    REDEFINE BITMAP RESOURCE "Calendar" ADJUST ID 105 OF oDlg ON CLICK (Fec1 := MsgDate (Fec1),oFec1:Refresh())
    REDEFINE BITMAP RESOURCE "Calendar" ADJUST ID 106 OF oDlg ON CLICK (Fec2 := MsgDate (Fec2),oFec2:Refresh())

    REDEFINE BUTTON ID 103 OF oDlg ACTION (Seguir:=.T., oDlg:End())
    REDEFINE BUTTON ID 104 OF oDlg ACTION (Seguir:=.F., oDlg:End())

  ACTIVATE DIALOG oDlg CENTERED
in *.RC i found

Code: Select all

COGEFECHAS DIALOG LOADONCALL MOVEABLE DISCARDABLE 95, 64, 189, 92
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CLASS "bordlg"
CAPTION "Entrada de un Rango de Fechas"
FONT 8, "MS Sans Serif"
{
 EDITTEXT 101, 35, 37, 36, 12
 EDITTEXT 102, 133, 37, 36, 12
 PUSHBUTTON "O.K.", 103, 32, 73, 50, 14
 PUSHBUTTON "Cancelar", 104, 100, 73, 50, 14
 CONTROL "", -1, "BorShade", 32769 | WS_CHILD | WS_VISIBLE, 5, 10, 181, 56
 LTEXT "Desde la Fecha", -1, 20, 22, 52, 9
 LTEXT "Hasta la Fecha", -1, 119, 22, 51, 9
 CONTROL "", 105, "TBitMap", 0 | WS_CHILD | WS_VISIBLE, 20, 36, 12, 14
 CONTROL "", 106, "TBitMap", 0 | WS_CHILD | WS_VISIBLE, 118, 36, 12, 14
}
so i ask Antonio what is the Benefit to use this Concept :?:
You create a RC file using a visual RC designer and then use it from your FWH app
You can use the one provided in Visual Studio Community, ResEdit, PellesC, etc there are many availables
You visually "draw" your screens instead of calculating coors by try and error...
---

under Fivewin all Controls, which are a CLASS, have METHOD ReDefine()
how to implement it in HMG :?:
have fun
Jimmy
User avatar
gfilatov
Posts: 1090
Joined: Fri Aug 01, 2008 5:42 am
Location: Ukraine
Contact:

Re: using REDEFINE and *.RC under HMG

Post by gfilatov »

Hi Jimmy,

This is not implemented in HMG because there is no support for Windows dialogs.

By the way, for all controls in MiniGUI there are such REDEFINE commands:

Code: Select all

   DEFINE DIALOG Dlg_2 OF MainForm  RESOURCE IDD_DLG1 FONT "Font_1" ;
         CAPTION "Modalless Data Edition "

      REDEFINE LABEL Lb2a ID IDC_STC3 VALUE cAge

      REDEFINE TEXTBOX tbox_2 ID IDC_EDT1 VALUE Val(cAge)  NUMERIC MAXLENGTH 2 ;
         ON CHANGE TextBoxChange1()

      REDEFINE  BUTTON Btn1 ID IDC_BTN1 CAPTION "&Accept"   ;
         ACTION {|| MainForm.Lbl_2.Value:= Str(Dlg_2.tbox_2.Value), _ReleaseDialog ( )} ;
            DEFAULT

      REDEFINE  BUTTON Btn2 ID IDC_BTN2 CAPTION "&Cancel"  ;
         ACTION {|| Dlg_2.tbox_2.Value := "",_ReleaseDialog ( ) }

      REDEFINE  BUTTON Btn3 ID IDC_BTN3 CAPTION "&Exit"  ;
         ACTION {|| _ReleaseDialog ( ) }

   END DIALOG
I hope this is helpful. :idea:
Kind Regards,
Grigory Filatov

"Everything should be made as simple as possible, but no simpler." Albert Einstein
User avatar
AUGE_OHR
Posts: 2093
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany

Re: using REDEFINE and *.RC under HMG

Post by AUGE_OHR »

hi Grigory
gfilatov wrote: Fri Mar 31, 2023 9:12 am By the way, for all controls in MiniGUI there are such REDEFINE commands:
WOW,
i did not know that, thx

Question :
how does REDEFINE a "say" ("Static") when ID are 0xFFFF or -1 :?:
have fun
Jimmy
Post Reply