Modifly on fly text of Say and button objects
Posted: Mon Dec 08, 2014 5:36 pm
Hi,
This is the question:
In function "traduci" I modify the text of tsay and tbutton objects in the dialog
There are other not-redefined object in RC files
Is it possible to modify these objects too?
(NOT REDEFINED)
Thanks to all
Marco
This is RC file
This is the question:
In function "traduci" I modify the text of tsay and tbutton objects in the dialog
There are other not-redefined object in RC files
Is it possible to modify these objects too?
(NOT REDEFINED)
Thanks to all
Marco
Code: Select all
#include "fivewin.ch"
FUNCTION MAIN()
LOCAL oDlg
LOCAL oSay1
LOCAL oBut1
DEFINE DIALOG oDlg RESOURCE "DIALOGO"
REDEFINE SAY oSay1 PROMPT "Primo Testo" ID 401 OF oDlg
REDEFINE BUTTON oBut1 ID 201 OF oDlg
ACTIVATE DIALOG oDlg ON INIT traduci( oDlg )
RETURN NIL
FUNCTION TRADUCI( oDlg )
LOCAL j , oCtl
FOR j = 1 TO LEN( oDlg:aControls )
oCtl = oDlg:aControls[ j ]
IF oCtl:classname = "TSAY" .OR. oCtl:classname = "TBUTTON"
oCtl:settext( "MARCO" )
ENDIF
NEXT j
RETURN NIL
This is RC file
Code: Select all
// RESOURCE SCRIPT generated by "Pelles C for Windows, version 6.00".
#include <windows.h>
#include <commctrl.h>
#include <richedit.h>
DIALOGO DIALOG DISCARDABLE 10, 28, 399, 136
STYLE WS_POPUP|DS_MODALFRAME|WS_CAPTION|WS_SYSMENU|WS_VISIBLE
CAPTION "Dialogo"
FONT 8, "MS Sans Serif"
{
CONTROL "First Say", 401, "Static", WS_GROUP, 4, 8, 56, 10
CONTROL "", 101, "Edit", WS_BORDER|WS_TABSTOP, 68, 7, 134, 12
CONTROL "Send", 201, "Button", BS_DEFPUSHBUTTON|WS_TABSTOP, 80, 80, 84, 24
CONTROL "Cancel", 202, "Button", WS_TABSTOP, 176, 80, 84, 24
CONTROL "Second Say", 402, "Static", WS_GROUP, 4, 25, 56, 10
CONTROL "", 102, "Edit", WS_BORDER|WS_TABSTOP, 68, 24, 134, 12
}