Page 1 of 1

using REDEFINE and *.RC under HMG

Posted: Fri Mar 31, 2023 8:20 am
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 :?:

Re: using REDEFINE and *.RC under HMG

Posted: Fri Mar 31, 2023 9:12 am
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:

Re: using REDEFINE and *.RC under HMG

Posted: Sun Apr 02, 2023 4:01 am
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 :?: