TTitle not displayed correctly and RTF just allow single line. Can't even press Enter
FWH1912 + BCC + HB
![Image](https://i.postimg.cc/sgWhBc30/foldex.jpg)
How TTitle should have looked
![Image](https://i.postimg.cc/1tqgXkbd/foldex2.jpg)
- Code: Select all Expand view
#include "fivewin.CH"
#include "ttitle.ch"
#include "RichEdit.ch"
procedure main()
hr():activate()
return
//----------------------------------------------------------------------
class hr
data oDlg, oSay, hRtfDll
data oDbPerson, oFolder
data hoTitles, hoGets, hGets init {=>}
method activate()
method createTitle(oTitle, oFont)
method refresh()
endclass
//----------------------------------------------------------------------
method activate() class HR
LOCAL cNotes, oBtnOK, oBtnCnl, oBtnPrn, oSay, oldarea := select()
LOCAL cTitl := "Title On FolderEx", oFont3, oFnt
local omfont2 :=TFont():New( "TIMES NEW ROMAN", 0, -24, .F., .f., 0, 1, 650,.T.,,, 0, 3, 2, 1 )
LOCAL bReturn := < ||
oFnt:end()
oMFont2:end()
oFont3:end()
>
local cGet := "", oTitle, cName, o := self
DEFINE FONT oFnt NAME "SYSTEM_FIXED_FONT" SIZE 0, -12
DEFINE FONT oFont3 NAME "Verdana" SIZE 0, -20 bold
::hGets["edu_1"] := ""
::hGets["edu_2"] := ""
::hGets["edu_3"] := ""
::hRtfDll := LoadLibrary( "Riched20.dll" )
DEFINE DIALOG ::oDlg RESOURCE "hr" TITLE cTitl FONT oFnt
REDEFINE FOLDEREX ::oFolder ID 110 OF ::oDlg ;
PROMPT "&Education", "&Others" DIALOGS "hr_edu", "Sub1" BOTTOM
// sub- folders
REDEFINE TITLE ::hoTitles["edu_1"] ID 102 of ::oFolder:aDialogs[1] SHADOW BOTTOMRIGHT
REDEFINE RICHEDIT ::hoGets["edu_1"] VAR ::hGets["edu_1"] ID 301 OF ::oFolder:aDialogs[1]
REDEFINE TITLE ::hoTitles["edu_2"] ID 104 of ::oFolder:aDialogs[1] SHADOW BOTTOMRIGHT
REDEFINE RICHEDIT ::hoGets["edu_2"] VAR ::hGets["edu_1"] ID 105 OF ::oFolder:aDialogs[1]
REDEFINE TITLE ::hoTitles["edu_3"] ID 101 of ::oFolder:aDialogs[1] SHADOW BOTTOMRIGHT
REDEFINE RICHEDIT ::hoGets["edu_3"] VAR ::hGets["edu_1"] ID 106 OF ::oFolder:aDialogs[1]
REDEFINE BUTTON oBtnOK ID 111 OF ::oDlg ;
ACTION ( ;
oBtnCnl:click() ;
)
REDEFINE BUTTON oBtnCnl ID 112 OF ::oDlg ;
ACTION ( ;
::oDlg:End() ;
) ;
REDEFINE BUTTON oBtnPrn ID 113 OF ::oDlg
ACTIVATE DIALOG ::oDlg CENTERED ;
ON INIT ( ;
o:refresh(), ;
o:CreateTitle(o:hoTitles["edu_1"], oFont3, "Formal Education"), ;
o:CreateTitle(o:hoTitles["edu_2"], oFont3, "Tertiary Education"), ;
o:CreateTitle(o:hoTitles["edu_3"], oFont3, "Professional Education") ;
) ;
EVAL( bReturn )
FreeLibrary( ::hRtfDll )
RETURN (NIL)
//---------------------------------------------------------------------------
method refresh() class HR
/*
::oSay:varput(trim(::oDbPerson:name)+" ("+ trim(::oDbPerson:empno) + ")")
::hoGets["edu_1"]:LoadRtf( ::oDbPerson:rtf_edu1 )
::hoGets["edu_2"]:LoadRtf( ::oDbPerson:rtf_edu2 )
::hoGets["edu_3"]:LoadRtf( ::oDbPerson:rtf_edu3 )
*/
::oDlg:update()
return nil
//----------------------------------------------------------------------
method CreateTitle( oTitle, oFont, cText ) class HR
/*
oTitle:lBorder:=.T.
oTitle:aGrdBack = { { 1, nRGB( 129, 130, 138 ), nRGB( 59, 60, 62 ) } }
*/
@ 12, 55 TITLETEXT OF oTitle TEXT cText FONT oFont
* @ 10, 10 TITLEIMG OF oTitle RESNAME "users" SIZE 30, 30 REFLEX TRANSPARENT
return nil
- Code: Select all Expand view
hr DIALOG 45, 30, 434, 393
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
FONT 10, "System"
{
CONTROL "", 110, "TFolderEx", WS_VISIBLE | WS_TABSTOP, 4, 52, 424, 304
CONTROL "&Ok", 111, "BUTTON", BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 132, 369, 50, 14
CONTROL "&Cancel", 112, "BUTTON", BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 192, 369, 50, 14
CONTROL "&Print", 113, "BUTTON", BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 253, 369, 50, 14
}
hr_edu DIALOG 23, 82, 292, 351
STYLE WS_CHILD
{
CONTROL "Custom control", 102, "TTITLE", WS_CHILD | WS_VISIBLE, 4, 2, 284, 20
CONTROL "", 301, "RichEdit20A", ES_LEFT | ES_MULTILINE | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_VSCROLL | WS_TABSTOP, 3, 24, 286, 88
CONTROL "", 105, "RichEdit20A", ES_LEFT | ES_MULTILINE | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_VSCROLL | WS_TABSTOP, 2, 143, 286, 88
CONTROL "Custom control", 104, "TTITLE", WS_CHILD | WS_VISIBLE, 3, 121, 284, 20
CONTROL "", 106, "RichEdit20A", ES_LEFT | ES_MULTILINE | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_VSCROLL | WS_TABSTOP, 2, 258, 286, 88
CONTROL "Custom control", 101, "TTITLE", WS_CHILD | WS_VISIBLE, 3, 236, 284, 20
}
SUB1 DIALOG 23, 82, 292, 167
STYLE WS_CHILD
{
CONTROL "", 301, "EDIT", ES_LEFT | ES_MULTILINE | ES_AUTOVSCROLL | ES_WANTRETURN | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_VSCROLL | WS_TABSTOP, 3, 2, 286, 162
}