Hi,
Is there an existing popup info dialog like MsgBox, that allows you to select part of the message, in order to copy and paste it elsewhere?
Pastable MsgBox popup
Moderator: Rathinagiri
- Claudio Ricardo
- Posts: 367
- Joined: Tue Oct 27, 2020 3:38 am
- DBs Used: DBF, MySQL, MariaDB
- Location: Bs. As. - Argentina
Re: Pastable MsgBox popup
Hi HG.
I think you'll have to do it with a small window with a read-only EditBox or RichEdit control...
I will do something like this to highlight in bold or color part of the text.
I think you'll have to do it with a small window with a read-only EditBox or RichEdit control...
I will do something like this to highlight in bold or color part of the text.
Corrige al sabio y lo harás más sabio, Corrige al necio y lo harás tu enemigo.
WhatsApp / Telegram: +54 911-63016162
WhatsApp / Telegram: +54 911-63016162
-
HGAutomator
- Posts: 202
- Joined: Thu Jul 16, 2020 5:42 pm
- DBs Used: DBF
Re: Pastable MsgBox popup
Yep, that's what I thought. Ok, thanks C.R.
Claudio Ricardo wrote: ↑Mon Dec 13, 2021 6:07 pm Hi HG.
I think you'll have to do it with a small window with a read-only EditBox or RichEdit control...
I will do something like this to highlight in bold or color part of the text.
- Claudio Ricardo
- Posts: 367
- Joined: Tue Oct 27, 2020 3:38 am
- DBs Used: DBF, MySQL, MariaDB
- Location: Bs. As. - Argentina
Re: Pastable MsgBox popup
Hello, This allows you to copy and what I needed: to highlight part of the text, in addition to changing font and size.
It could be done much better and more neat (even put color) but I have little time for a lot of work.
It could be done much better and more neat (even put color) but I have little time for a lot of work.
Code: Select all
cText := "+CRLF Está seguro/a de querer eliminar {TODOS} los datos ? +CRLF Esta acción {NO} puede deshacerse !"
If MsgSiNo ( cText, "Atención !", 150, 320 )
Code: Select all
If MsgSiNo ( cText, "Atención !", 160, 400, "Times-Roman", 12 )
Code: Select all
#include <hmg.ch>
Function MsgSiNo ( cString, cTitle, nHeight, nWidth, cFontName, nFontSize )
LOCAL cText := ""
PRIVATE lRetu := .F.
Default cTitle := ""
Default nHeight := 160
Default nWidth := 400
Default cFontName := "Arial"
Default nFontSize := 9
cString := StrTran ( cString, "+CRLF", "\par" )
cString := HMG_Unicode_To_Ansi ( cString )
cText := '{\rtf1\ansi\pard '
cText += StrTran ( cString, "{", "{\b " )
cText += '}'
Hb_MemoWrit ("Text.rtf", cText)
cText := Hb_MemoRead ("Text.rtf")
DEFINE WINDOW Win_1 AT 0,0 WIDTH nWidth HEIGHT nHeight TITLE cTitle MODAL BACKCOLOR {255,255,255} NOSYSMENU
DEFINE RICHEDITBOX Edit_1
ROW 0
COL 0
WIDTH nWidth - 16
HEIGHT nHeight - 80
VALUE ""
READONLY .T.
FONTNAME cFontName
FONTSIZE nFontSize
TABSTOP .F.
HSCROLL .F.
VSCROLL .F.
END RICHEDITBOX
DEFINE BUTTON Button_1
ROW nHeight - 75
COL nWidth - 240
WIDTH 100
HEIGHT 28
ACTION ExitMsg (.T.)
CAPTION "Ok"
END BUTTON
DEFINE BUTTON Button_2
ROW nHeight - 75
COL nWidth - 125
WIDTH 100
HEIGHT 28
ACTION ExitMsg (.F.)
CAPTION "Cancel"
END BUTTON
END WINDOW
CENTER WINDOW Win_1
Win_1.Edit_1.RTFLoadFile ("Text.rtf", .F., 4)
ACTIVATE WINDOW Win_1
Return lRetu
//--------------------------------------------------------------------------------------------------//
STATIC Procedure ExitMsg (lParam)
Default lParam := .F.
If lParam
lRetu := .T.
EndIf
Ferase ( "Text.rtf" )
DoMethod ("Win_1" , "Release")
Return Nil
Corrige al sabio y lo harás más sabio, Corrige al necio y lo harás tu enemigo.
WhatsApp / Telegram: +54 911-63016162
WhatsApp / Telegram: +54 911-63016162
-
HGAutomator
- Posts: 202
- Joined: Thu Jul 16, 2020 5:42 pm
- DBs Used: DBF
Re: Pastable MsgBox popup
Looks more than adequate, thanks Claudio.
Claudio Ricardo wrote: ↑Wed Dec 15, 2021 7:49 pm Hello, This allows you to copy and what I needed: to highlight part of the text, in addition to changing font and size.
It could be done much better and more neat (even put color) but I have little time for a lot of work.Screenshot_20211215_163105.pngCode: Select all
cText := "+CRLF Está seguro/a de querer eliminar {TODOS} los datos ? +CRLF Esta acción {NO} puede deshacerse !" If MsgSiNo ( cText, "Atención !", 150, 320 )Screenshot_20211215_162434.pngCode: Select all
If MsgSiNo ( cText, "Atención !", 160, 400, "Times-Roman", 12 )Code: Select all
#include <hmg.ch> Function MsgSiNo ( cString, cTitle, nHeight, nWidth, cFontName, nFontSize ) LOCAL cText := "" PRIVATE lRetu := .F. Default cTitle := "" Default nHeight := 160 Default nWidth := 400 Default cFontName := "Arial" Default nFontSize := 9 cString := StrTran ( cString, "+CRLF", "\par" ) cString := HMG_Unicode_To_Ansi ( cString ) cText := '{\rtf1\ansi\pard ' cText += StrTran ( cString, "{", "{\b " ) cText += '}' Hb_MemoWrit ("Text.rtf", cText) cText := Hb_MemoRead ("Text.rtf") DEFINE WINDOW Win_1 AT 0,0 WIDTH nWidth HEIGHT nHeight TITLE cTitle MODAL BACKCOLOR {255,255,255} NOSYSMENU DEFINE RICHEDITBOX Edit_1 ROW 0 COL 0 WIDTH nWidth - 16 HEIGHT nHeight - 80 VALUE "" READONLY .T. FONTNAME cFontName FONTSIZE nFontSize TABSTOP .F. HSCROLL .F. VSCROLL .F. END RICHEDITBOX DEFINE BUTTON Button_1 ROW nHeight - 75 COL nWidth - 240 WIDTH 100 HEIGHT 28 ACTION ExitMsg (.T.) CAPTION "Ok" END BUTTON DEFINE BUTTON Button_2 ROW nHeight - 75 COL nWidth - 125 WIDTH 100 HEIGHT 28 ACTION ExitMsg (.F.) CAPTION "Cancel" END BUTTON END WINDOW CENTER WINDOW Win_1 Win_1.Edit_1.RTFLoadFile ("Text.rtf", .F., 4) ACTIVATE WINDOW Win_1 Return lRetu //--------------------------------------------------------------------------------------------------// STATIC Procedure ExitMsg (lParam) Default lParam := .F. If lParam lRetu := .T. EndIf Ferase ( "Text.rtf" ) DoMethod ("Win_1" , "Release") Return Nil