topic
stringlengths
1
63
text
stringlengths
1
577k
Add some functions for Tensorflow
Hi Charles, Good job.
Add some functions for Tensorflow
Hello Richard, I already add a Tensorflow graph browser^^ [code=fw:1d84ra32]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">function</span> Main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oTF &nbsp;:= TensorFlow<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">LOCAL</span> nOp<br />&nbsp; &nbsp;<span style="color: #00C800;">LOCAL</span> nCounter := <span style="color: #000000;">0</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">LOCAL</span> nPos := <span style="color: #000000;">1</span><br />&nbsp; &nbsp;<span style="color: #00C800;">LOCAL</span> nOld := <span style="color: #000000;">0</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">LOCAL</span> aInfo := <span style="color: #000000;">&#123;</span><span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">LOCAL</span> aGraphInfo := <span style="color: #000000;">&#123;</span><span style="color: #000000;">&#125;</span><br /><br />&nbsp; &nbsp;oTF:<span style="color: #000000;">ImportGraph</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"graph.pb"</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">WHILE</span> .T.<br />&nbsp; &nbsp; &nbsp; &nbsp;nOp := oTF:<span style="color: #000000;">GraphNextOperation</span><span style="color: #000000;">&#40;</span> @nPos <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">IF</span> nOp == <span style="color: #000000;">0</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;EXIT<br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">ENDIF</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp;aInfo := <span style="color: #000000;">&#123;</span> TF_OperationName<span style="color: #000000;">&#40;</span> nOp <span style="color: #000000;">&#41;</span>,TF_OperationOpType<span style="color: #000000;">&#40;</span> nOp <span style="color: #000000;">&#41;</span>, TF_OperationDevice<span style="color: #000000;">&#40;</span> nOp <span style="color: #000000;">&#41;</span>, TF_OperationNumOutputs<span style="color: #000000;">&#40;</span> nOp <span style="color: #000000;">&#41;</span>, TF_OperationNumInputs<span style="color: #000000;">&#40;</span> nOp <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp;AADD <span style="color: #000000;">&#40;</span> aGraphInfo, aInfo <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">IF</span> nPos == nOld<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; EXIT<br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">ENDIF</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">ENDDO</span><br /><br />&nbsp; &nbsp;Show_TFGraphInfo<span style="color: #000000;">&#40;</span> aGraphInfo <span style="color: #000000;">&#41;</span><br /><br /><br /><br />&nbsp; &nbsp;<span style="color: #B900B9;">// &nbsp;MsgInfo( oTF:Version() )</span><br />&nbsp; &nbsp;<span style="color: #B900B9;">// oTF:Run( oTF:Mul( oTF:Constant( 5, "Five" ), oTF:Constant( 3, "three" ) ) )</span><br />&nbsp; &nbsp;<span style="color: #B900B9;">// MsgInfo( oTF:Output() )</span><br /><br />&nbsp; &nbsp;oTF:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #00C800;">STATIC</span> <span style="color: #00C800;">FUNCTION</span> Show_TFGraphInfo<span style="color: #000000;">&#40;</span> aGraphInfo <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">LOCAL</span> oWnd, oBar, oBrw<br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">WINDOW</span> oWnd <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"Tensorflow Graph information"</span> <span style="color: #0000ff;">FROM</span> <span style="color: #000000;">0</span>,<span style="color: #000000;">0</span> <span style="color: #0000ff;">TO</span> <span style="color: #000000;">40</span>, <span style="color: #000000;">100</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTONBAR</span> OBAR <span style="color: #0000ff;">OF</span> oWnd <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">100</span>,<span style="color: #000000;">32</span> <span style="color: #000000;">2007</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">OF</span> oBar <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Open"</span> &nbsp; <span style="color: #0000ff;">ACTION</span> oWnd:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> GROUP<br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">OF</span> oBar <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Close"</span> &nbsp; <span style="color: #0000ff;">ACTION</span> oWnd:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> GROUP<br /><br />&nbsp; &nbsp;SET <span style="color: #0000ff;">MESSAGE</span> <span style="color: #0000ff;">OF</span> oWnd <span style="color: #0000ff;">TO</span> <span style="color: #ff0000;">"c)Charles Kwon"</span> <span style="color: #000000;">2007</span><br /><br />&nbsp; &nbsp;@ <span style="color: #000000;">0</span>,<span style="color: #000000;">0</span> <span style="color: #0000ff;">XBROWSE</span> oBrw <span style="color: #0000ff;">OF</span> oWnd &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;<br />&nbsp; &nbsp; &nbsp; COLUMNS <span style="color: #000000;">1</span>, <span style="color: #000000;">2</span>, <span style="color: #000000;">3</span>, <span style="color: #000000;">4</span>,<span style="color: #000000;">5</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;;<br />&nbsp; &nbsp; &nbsp; HEADERS <span style="color: #ff0000;">"Operation Name"</span>,<span style="color: #ff0000;">"Type"</span>,<span style="color: #ff0000;">"Device"</span>,<span style="color: #ff0000;">"Output"</span>, <span style="color: #ff0000;">"Inpout"</span> &nbsp; ;<br />&nbsp; &nbsp; &nbsp; COLSIZES <span style="color: #000000;">200</span>, <span style="color: #000000;">100</span>, <span style="color: #000000;">100</span>, <span style="color: #000000;">100</span>,<span style="color: #000000;">100</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;<br />&nbsp; &nbsp; &nbsp; ARRAY aGraphInfo CELL<br /><br />&nbsp; &nbsp;WITH OBJECT oBrw<br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;END<br /><br />&nbsp; &nbsp;oWnd:<span style="color: #000000;">oClient</span> := oBrw<br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">WINDOW</span> oWnd<br /><br /><br /><br /><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /><br /><br /><br />&nbsp;</div>[/code:1d84ra32]
Add some functions for Tensorflow
Thank you. Can you please share graph.pb and tensorflow.dll?.
Add some functions for Tensorflow
Up
Add some functions for Tensorflow
Hello Charles, thank you so much for your work. I am very interested in this new techniques. Would you be so kind to advice a novice some basic literature where to start. Best regards Otto
Add tooltip to Tget
I think add tooltip to tget class is better than nower message to the user to have a input guide. Shuming Wang
Add tooltip to Tget
Shuming, You may do: <oAnyControl>:cTooltTip = <cText>
Add tooltip to Tget
Antonio, Thank you! Shuming Wang
AddHRuler()
is it possible ad a ruler also on richedit class ?
AddHRuler()
Silvio, It seems as Windows does not provide a ruler for the standard RichEdit control Here there is an example to implement one: [url:37chmjd2]http&#58;//www&#46;codeproject&#46;com/Articles/22783/Advanced-Text-Editor-with-Ruler[/url:37chmjd2]
AddHRuler()
Antonio, I saw your richedit box at fw for apple ... from source of codeproject you not Know how make it on richedit ? or perhaps modifing the tregla class
AddHRuler()
Silvio, You can place a bitmap over the richedit control with the ruler painted
AddHRuler()
I thinked we can use the slider control used to mage choosegradient function but only U can create it because I not see choosegradient source
AddMethod() y __clsAddMsg()
Hola a todos, Donde puedo encontrar información sobre este método y función, y cómo poder usarlos? Saludos y gracias. Carlos G.
Added support for colors in browse lines
Implemented colors support for browse lines, both background and text, example: [code=fw:1kakecax]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"FiveLinux.ch"</span><br /><br />REQUEST DBFCDX<br /><br /><span style="color: #00C800;">function</span> Main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">local</span> oWnd, oBrw<br /><br />   USE customer VIA <span style="color: #ff0000;">"DBFCDX"</span><br /><br />   <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">WINDOW</span> oWnd <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"Testing Browses"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">522</span>, <span style="color: #000000;">317</span><br /><br />   @ <span style="color: #000000;">2</span>, <span style="color: #000000;">2</span> BROWSE oBrw <span style="color: #0000ff;">OF</span> oWnd ;<br />      HEADERS <span style="color: #ff0000;">"First"</span>, <span style="color: #ff0000;">"Last"</span>, <span style="color: #ff0000;">"Street"</span>, <span style="color: #ff0000;">"City"</span>, <span style="color: #ff0000;">"State"</span>, <span style="color: #ff0000;">"Zip"</span> ;<br />      FIELDS  First, Last, Street, City, State, Zip<br /><br />   oBrw:<span style="color: #000000;">nClrPane</span> = <span style="color: #000000;">&#123;</span> | nRow, lSelected | <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> ! lSelected, <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> nRow % <span style="color: #000000;">2</span> == <span style="color: #000000;">0</span>, CLR_GREEN, CLR_WHITE <span style="color: #000000;">&#41;</span>, <span style="color: #00C800;">nil</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <br />   oBrw:<span style="color: #000000;">nClrText</span> = <span style="color: #000000;">&#123;</span> | nRow, lSelected | <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> ! lSelected, <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> nRow % <span style="color: #000000;">2</span> == <span style="color: #000000;">0</span>, CLR_YELLOW, CLR_BLACK <span style="color: #000000;">&#41;</span>, <span style="color: #00C800;">nil</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <br /><br />   @ <span style="color: #000000;">28</span>, <span style="color: #000000;">2</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">"_Ok"</span> <span style="color: #0000ff;">OF</span> oWnd <span style="color: #0000ff;">ACTION</span> oWnd:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">WINDOW</span> oWnd<br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span></div>[/code:1kakecax] [img:1kakecax]http&#58;//img233&#46;imageshack&#46;us/img233/8485/screenshotmf&#46;png[/img:1kakecax]
Added support for colors in browse lines
Intresting
Adding Context Specific Help to a Say
Is it possible to add context specific help to a 'Say'? This line compiles fine: ReDefine Say ioTELEPHONE Var cTELEPHONE ID 103 Of oDlg HelpID but if you add ANYTHING after the HelpID like: ReDefine Say ioTELEPHONE Var cTELEPHONE ID 103 Of oDlg HelpID 5000 you get an error. Now you may wonder why I would want a HelpID on a 'Say'. Well let me tell you: I have changed the resource type of all of my 'Says' (or LTEXT) on my 'view' dialogs to 'Gets' (or EDITTEXT) and made them readonly (but left them as 'Says' in the code). This has had the wonderous effect of displaying the 'Says' exactly as the 'Gets' appear (with beautiful borders around them and a different background color) and has given me the additional facility to actually click on a 'Say' but you cannot edit the field only navigate to the 'Say'. So I might as well then add context specific help to the 'Says' if possible!!! Regards, Dale.
Adding Context Specific Help to a Say
Actually - I even discovered another benefit of doing it this way: I can actually copy and paste from a 'Say' to somewhere else if needed!!! How about that! (Thanks Enrico)! Regards, Dale.
Adding Events to the EventLog in Windows
Is it possible to log events in the EventLog of Windows using FiveWin? Thanks, Byron ...
Adding Events to the EventLog in Windows
hi, there is a Sample under \HARBOUR\contrib\hbwin\tests\eventlog.prg in HMG using win_ReportEvent() from HbWin [code=fw:2xhuodo8]<div class="fw" id="{CB}" style="font-family: monospace;">#require <span style="color: #ff0000;">"hbwin"</span><br />PROCEDURE Main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   ? win_ReportEvent<span style="color: #000000;">&#40;</span> <span style="color: #00C800;">NIL</span>, <span style="color: #ff0000;">"Application"</span>, WIN_EVENTLOG_SUCCESS, <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span>, <span style="color: #ff0000;">"hello"</span> <span style="color: #000000;">&#41;</span><br />   ? win_ReportEvent<span style="color: #000000;">&#40;</span> <span style="color: #00C800;">NIL</span>, <span style="color: #ff0000;">"Application"</span>, WIN_EVENTLOG_SUCCESS, <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span>, <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"hello"</span>, <span style="color: #ff0000;">"world"</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">RETURN</span><br /> </div>[/code:2xhuodo8] i have not found any other Sample using win_ReportEvent()
Adding External DLL Calls
Hi Everybody, I have looked at many posts and am trying to add external DLL calls to my app. Can someone please tell me where I am going wrong. Syntax : Function Connect() as String Return values: Success - Port number Error - Empty String DLL32 FUNCTION Connect() AS LPSTR PASCAL LIB "\Ez\dll\POx.DLL" Syntax : Function Handshake() as Boolean Return values: Success - TRUE Error - FALSE DLL32 FUNCTION Handshake() AS BOOL PASCAL LIB "\Ez\dll\POx.DLL" Syntax : Function SetID(id as String) as Boolean Return values: Success - TRUE Error - FALSE DLL32 FUNCTION SetID(ID AS LPSTR) AS WORD PASCAL LIB "\Ez\dll\POx.DLL" Syntax : Function SetTime( cur_time as Date) as Boolean Return values: Success - TRUE Error - FALSE DLL32 FUNCTION SetTime(cur_time AS Date) AS WORD PASCAL LIB "\Ez\dll\POx.DLL" Syntax : Function SetInterval(interval as Integer) as Boolean Return values: Success - TRUE Error - FALSE DLL32 FUNCTION SetInterval(interval AS LONG) AS WORD PASCAL LIB "\Ez\dll\POx.DLL" Syntax : Function GetData(data_array()) as integer Return values: Success - Number of Data lines Error - 0 DLL32 FUNCTION GetData(data_array()) AS LONG PASCAL LIB "\Ez\dll\POx.DLL" Thanks, Jeff
Adding External DLL Calls
Jeff, Try it this way: [code:2ncxpy3h]local hPOX &#58;= LoadLibrary&#40; "\ez\dll\POX&#46;DLL" &#41; DLL32 FUNCTION &#46;&#46;&#46; LIB hPOX &#46;&#46;&#46; FreeLibrary&#40; hPOX &#41;[/code:2ncxpy3h] James
Adding External DLL Calls
Hi James, When I try it that way and issue the Connect() command I get the following error: Unrecoverable error 9003: Too many recursive error handler calls
Adding External DLL Calls
Jeff, I'm not experienced with DLL32 calls, but I notice other working calls (in my notes) use the FROM clause and the same name as the function with a trailing "A" so you might try: DLL32 FUNCTION Connect ... FROM "ConnectA" LIB hPOX If that doesn't work, hopefully someone else with DLL experience will help. James
Adding External DLL Calls
Thanks for trying James ... Still no luck.
Adding External DLL Calls
[quote="Jeff Barnes":29qkd50d]Syntax : Function Connect() as String Return values: Success - Port number Error - Empty String DLL32 FUNCTION Connect() AS LPSTR PASCAL LIB "\Ez\dll\POx.DLL"[/quote:29qkd50d] As far as I know, you can't return a string from a DLL function. Do you have any VB samples? [quote="Jeff Barnes":29qkd50d]Syntax : Function SetID(id as String) as Boolean Return values: Success - TRUE Error - FALSE DLL32 FUNCTION SetID(ID AS LPSTR) AS WORD PASCAL LIB "\Ez\dll\POx.DLL"[/quote:29qkd50d] AS BOOL instead of AS WORD. [quote="Jeff Barnes":29qkd50d]DLL32 FUNCTION SetTime(cur_time AS Date) AS WORD PASCAL LIB "\Ez\dll\POx.DLL"[/quote:29qkd50d] There's nothing like AS Date. [quote="Jeff Barnes":29qkd50d]DLL32 FUNCTION GetData(data_array()) AS LONG PASCAL LIB "\Ez\dll\POx.DLL"[/quote:29qkd50d] There's nothing like data_array() without data type. EMG
Adding External DLL Calls
Hi Enrico, Please check your email. Thanks, Jeff
Adding Metrobutton-frames on button-focus / action
I tested a solution adding buttonframes on METRO - buttons on action / click because there is a missing visible effect. ( showing white button-frames like in Windows10 ) I would like to do this on mousecaption as well, but bGotfocus and bLostfocus doesn't work ! The solution takes care of using normal or large buttons. It is working for me, but maybe there is still another solution possible. I noticed changing the button-pos., there is a problem. [img:stj7nkwt]http&#58;//www&#46;pflegeplus&#46;com/IMAGES/Mbtnframe1&#46;jpg[/img:stj7nkwt] [img:stj7nkwt]http&#58;//www&#46;pflegeplus&#46;com/IMAGES/Mbtnframe2&#46;jpg[/img:stj7nkwt] Download <!-- m --><a class="postlink" href="http://www.pflegeplus.com/DOWNLOADS/MBtnframe1.zip">http://www.pflegeplus.com/DOWNLOADS/MBtnframe1.zip</a><!-- m --> best regards Uwe <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D -->
Adding Metrobutton-frames on button-focus / action
Uwe, Your solution is a good one anyhow How did you try it using bGotfocus and bLostfocus ?
Adding Metrobutton-frames on button-focus / action
Antonio, I only changed / tested : DEFINE METROBUTTON oMBtn[1] OF oMetro ; PROMPT "Files" COLOR CLR_WHITE, RGB( 2, 174, 224 ) ; GROUP 1 ; IMAGE c_Path1 + "files.bmp" ; ACTION MsgInfo( oMBtn[1]:Cargo , ValType( oMBtn[1]:Cargo) ) // Files(c_Path1) // [color=#0040FF:9ob804ag]oMBtn[1]:bLClicked := {|| SHOW_FRAME(oMBtn, 1, nOld), nOld := 1 }[/color:9ob804ag] [color=#008000:9ob804ag]oMBtn[1]:bGotFocus := {|| SHOW_FRAME(oMBtn, 1, nOld), nOld := 1 }[/color:9ob804ag] oMBtn[1]:oFont := oFontSmall but NO response with the other solution I posted, there is still a problem changing the button-positions. I think the frame-painting on bGotfocus and bLostfocus would be the best. It is the same, like shown in Windows10 best regards Uwe <!-- s:?: --><img src="{SMILIES_PATH}/icon_question.gif" alt=":?:" title="Question" /><!-- s:?: -->
Adding Metrobutton-frames on button-focus / action
Uwe Are you using? [code=fw:22xnwf74]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><br />IsOverWnd<span style="color: #000000;">&#40;</span> hWnd, nRow, nCol <span style="color: #000000;">&#41;</span> --> lOver<br /><br />&nbsp;</div>[/code:22xnwf74]
Adding Metrobutton-frames on button-focus / action
Uwe, Please try this to check if the codeblock is evaluated: oMBtn[1]:bGotFocus := {|| MsgInfo( "yes" ), SHOW_FRAME(oMBtn, 1, nOld), nOld := 1 }
Adding Metrobutton-frames on button-focus / action
Antonio, tested, but there is NO response at all. best regards Uwe <!-- s:roll: --><img src="{SMILIES_PATH}/icon_rolleyes.gif" alt=":roll:" title="Rolling Eyes" /><!-- s:roll: -->
Adding Metrobutton-frames on button-focus / action
Antonio, [b:3ekgvwu2]I got it working[/b:3ekgvwu2] Now it looks like shown in Windows10. The solution I have been looking for : painting a frame on button-focus. Maybe possible to include the logic in class < [b:3ekgvwu2]Metropnl[/b:3ekgvwu2] > like : <!-- s:?: --><img src="{SMILIES_PATH}/icon_question.gif" alt=":?:" title="Question" /><!-- s:?: --> oMetro:lBtnFrame := .T. // frame YES / NO oMetro:nBtnFramePen := 4 // Pensize oMetro:nBtnFrameCol := CLR_WHITE // frame-color Download <!-- m --><a class="postlink" href="http://www.pflegeplus.com/DOWNLOADS/MetroBtn1.zip">http://www.pflegeplus.com/DOWNLOADS/MetroBtn1.zip</a><!-- m --> Instead using frames, it is possible to display a image on button-caption [img:3ekgvwu2]http&#58;//www&#46;pflegeplus&#46;com/IMAGES/Metrobtn3&#46;jpg[/img:3ekgvwu2] [code=fw:3ekgvwu2]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">FUNCTION</span> SHOW_FRAME<span style="color: #000000;">&#40;</span>oBtn, n, nOld, c_path1<span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">LOCAL</span> I, oImage<br /><br /><span style="color: #00C800;">FOR</span> I := <span style="color: #000000;">1</span> <span style="color: #0000ff;">TO</span> LEN<span style="color: #000000;">&#40;</span> oBtn <span style="color: #000000;">&#41;</span><br />     <span style="color: #00C800;">IF</span> oBtn<span style="color: #000000;">&#91;</span>I<span style="color: #000000;">&#93;</span> <> <span style="color: #00C800;">NIL</span>  <br />          <span style="color: #00C800;">IF</span> I = nOld .and. n <> nOld<br />               oBtn<span style="color: #000000;">&#91;</span>i<span style="color: #000000;">&#93;</span>:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />          <span style="color: #00C800;">ENDIF</span><br />          <span style="color: #B900B9;">// Using frames</span><br />          <span style="color: #B900B9;">//IF oBtn[I]:lLarge = .F. .and. i = n</span><br />          <span style="color: #B900B9;">//   RoundBox( hDC := oBtn[n]:GETDC(),  2, 2, oBtn[i]:nWidth()-1, ;</span><br />          <span style="color: #B900B9;">//                    oBtn[i]:nHeight(), , , CLR_WHITE, 4 )   </span><br />          <span style="color: #B900B9;">// ELSEIF oBtn[I]:lLarge = .T. .and. i = n</span><br />          <span style="color: #B900B9;">//   RoundBox( hDC := oBtn[n]:GETDC(),  2, 2, oBtn[i]:nWidth() -1, ;</span><br />          <span style="color: #B900B9;">//                    oBtn[i]:nHeight(), , , CLR_WHITE, 4 )  </span><br />          <span style="color: #B900B9;">// ENDIF</span><br />          hDC := oBtn<span style="color: #000000;">&#91;</span>n<span style="color: #000000;">&#93;</span>:<span style="color: #000000;">GETDC</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />          oImage := FILoadImg<span style="color: #000000;">&#40;</span> c_path1 + <span style="color: #ff0000;">"Select.bmp"</span> <span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">// can be different each button-group </span><br />          ABPaint<span style="color: #000000;">&#40;</span> hDC, <span style="color: #000000;">5</span>, <span style="color: #000000;">5</span>, oImage, <span style="color: #000000;">255</span> <span style="color: #000000;">&#41;</span><br />     <span style="color: #00C800;">ENDIF</span><br /><span style="color: #00C800;">NEXT</span><br /><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /> </div>[/code:3ekgvwu2] best regards Uwe <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D -->
Adding a C function
I have to admit I don't really understand how the whole PRG to C to EXE system works. And I am not a C programmer. I have a C program with a function, lets call it "Myfunction" in it, defined like this: CLIPPER MYFUNCTION( PARAMS ) ... This is compiled using BCC then linked with the PRGs. But the linker errors out with: undefined external '_HB_FUN_MYFUNCTION' I presume this is because the function call to MYFUNCTION in the PRG is being translated by the preprocessor to _HB_FUN_MYFUNCTION. If I change the name of the C function to _HB_FUN_MYFUNCTION then I get a bunch more errors. OK, so can someone tell me the secret to getting this working? Regards, James
Adding a C function
You have to use [code=fw:2sbylhic]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">HB_FUNC</span><span style="color: #000000;">&#40;</span> MYFUNCTION <span style="color: #000000;">&#41;</span></div>[/code:2sbylhic] in [x]Harbour. EMG
Adding a C function
Enrico, I'm sorry I still don't understand. Do you mean in the C program? Change this: CLIPPER MYFUNCTION( PARAMS ) To this? HB_FUNC( MYFUNCTION ) Or, ? I am using xHarbour. James
Adding a C function
OK, I changed it to: HB_FUNC( MYFUNCTION ( PARAMS ) ) Then I get these compiler errors: Error E2147 source\inifunc.c 24: 'MYFUNCTION' cannot start a parameter declaration Error E2293 source\inifunc.c 24: ) expected This is the way the FWH\tools\clp2harb.exe program seems to be doing it. I still must be doing something wrong. James
Adding a C function
I now see that clp2harb.exe is changing it like this: HB_FUNC( MYFUNCTION ) So I tried that and I get these errors: Warning W8070 source\inifunc.c 18: Function should return a value in function HB_FUNC Warning W8057 source\inifunc.c 18: Parameter 'MYFUNCTION' is never used in function HB_FUNC Error E2293 source\inifunc.c 54: ) expected Here is the complete code for my test function, MYFUNCTION. [code=fw:3v251mrs]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">HB_FUNC</span><span style="color: #000000;">&#40;</span> MYFUNCTION <span style="color: #000000;">&#41;</span><br /><span style="color: #000000;">&#123;</span><br />   _retni<span style="color: #000000;">&#40;</span> GetProfileInt<span style="color: #000000;">&#40;</span> _parc<span style="color: #000000;">&#40;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span>, <br />                          _parc<span style="color: #000000;">&#40;</span> <span style="color: #000000;">2</span> <span style="color: #000000;">&#41;</span>,      <br />                          _parni<span style="color: #000000;">&#40;</span> <span style="color: #000000;">3</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>; <br /><span style="color: #000000;">&#125;</span></div>[/code:3v251mrs] James
Adding a C function
James, Please change it this way: [code=fw:liy06v50]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">HB_FUNC</span><span style="color: #000000;">&#40;</span> MYFUNCTION <span style="color: #000000;">&#41;</span><br /><span style="color: #000000;">&#123;</span><br />   hb_retni<span style="color: #000000;">&#40;</span> GetProfileInt<span style="color: #000000;">&#40;</span> hb_parc<span style="color: #000000;">&#40;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span>, hb_parc<span style="color: #000000;">&#40;</span> <span style="color: #000000;">2</span> <span style="color: #000000;">&#41;</span>, hb_parni<span style="color: #000000;">&#40;</span> <span style="color: #000000;">3</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>; <br /><span style="color: #000000;">&#125;</span><br /> </div>[/code:liy06v50]
Adding a C function
Antonio, I tried that already and I get this error: Warning W8065 source\inifunc.c 20: Call to function 'GetProfileInt' with no prototype in function HB_FUN_MYFUNCTION James [code=fw:1h9s1jm6]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"hbapifs.h"</span><br /><br /><span style="color: #00C800;">HB_FUNC</span><span style="color: #000000;">&#40;</span> MYFUNCTION <span style="color: #000000;">&#41;</span><br /><span style="color: #000000;">&#123;</span><br />&nbsp; &nbsp;hb_retni<span style="color: #000000;">&#40;</span> GetProfileInt<span style="color: #000000;">&#40;</span> hb_parc<span style="color: #000000;">&#40;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span>,<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; hb_parc<span style="color: #000000;">&#40;</span> <span style="color: #000000;">2</span> <span style="color: #000000;">&#41;</span>,<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; hb_parni<span style="color: #000000;">&#40;</span> <span style="color: #000000;">3</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>;<br /><span style="color: #000000;">&#125;</span></div>[/code:1h9s1jm6]
Adding a C function
James, You have to add: #include <windows.h> so Windows API functions are properly identified.
Adding a C function
Antonio, Yea! That did it. Thanks! I guess I shot myself in the foot. I thought I would start with a known good C program so I selected one from the FWH\source directory. Now it seems that these are not compiled as-is but they have to go through some preprocessing before they can be compiled. Is that true? James
Adding a C function
James, In FWH 9.08 we have removed CLIPPER ... and PARAMS from all C modules, as we only focus on Harbour and xHarbour now. If you use FWH 9.08 then there is no need to use clp2harb.exe never more to compile FWH C modules <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
Adding a C function
I have another question. Is this a complete function definition? void pascal DelResource( HANDLE hRes ); The compiler doesn't error, but the linker gives an "unresolved external DelResource" error. James
Adding a C function
James, [quote:1h2ra8wv]void pascal DelResource( HANDLE hRes );[/quote:1h2ra8wv] Thats what is called a function "prototype": It instructs the C compiler how to manage that function, but it does not implement its code. [quote:1h2ra8wv]The compiler doesn't error, but the linker gives an "unresolved external DelResource" error.[/quote:1h2ra8wv] FiveWin provides such function, so if you link with FiveHC.lib then the linker should find it.
Adding a C function
Wiki documentation for it: [url:3vfzk29i]http&#58;//wiki&#46;fivetechsoft&#46;com/doku&#46;php?id=fivewin_function_delresource[/url:3vfzk29i]
Adding a Multilanguage-solution to Your App.
Hello, I started the first time, adding a Multilanguage-option to a App. First I wanted to use a DBF, but now I found a better Solution. How it works ( Sample ) : [color=#FF0000:1ib7ffsf]1. [/color:1ib7ffsf] Define a Static Var cLang[40] // contains the needed Keywords [color=#FF0000:1ib7ffsf]2.[/color:1ib7ffsf] Array-Init I := 1 FOR i := 1 TO 40 cLang[I] := " " NEXT [color=#FF0000:1ib7ffsf]3.[/color:1ib7ffsf] Load on Top of Your App GET_LANG() // Get Keywords from INI [color=#FF0000:1ib7ffsf]4.[/color:1ib7ffsf] Get Keywords from INI [code=fw:1ib7ffsf]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #B900B9;">// --------- INI - Read -------------</span><br /><br /><span style="color: #00C800;">FUNCTION</span> GET_LANG<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">Local</span> oInifile <br /><br /><span style="color: #00C800;">IF</span> !FILE <span style="color: #000000;">&#40;</span> c_path + <span style="color: #ff0000;">"<span style="color: #000000;">\L</span>ANGUAGE.ini"</span> <span style="color: #000000;">&#41;</span><br />    SAVE_LANG<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">ELSE</span><br />    INI oInifile FILE c_path + <span style="color: #ff0000;">"<span style="color: #000000;">\L</span>ANGUAGE.INI"</span><br />        <span style="color: #0000ff;">GET</span>  cLang<span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span>  SECTION  <span style="color: #ff0000;">"Language"</span>  ENTRY <span style="color: #ff0000;">"Game"</span>            <span style="color: #0000ff;">OF</span> oInifile <span style="color: #00C800;">DEFAULT</span> <span style="color: #ff0000;">"Game"</span><br />        <span style="color: #0000ff;">GET</span>  cLang<span style="color: #000000;">&#91;</span><span style="color: #000000;">2</span><span style="color: #000000;">&#93;</span>  SECTION  <span style="color: #ff0000;">"Language"</span>  ENTRY <span style="color: #ff0000;">"Trials"</span>          <span style="color: #0000ff;">OF</span> oInifile <span style="color: #00C800;">DEFAULT</span> <span style="color: #ff0000;">"Trials"</span><br />        <span style="color: #0000ff;">GET</span>  cLang<span style="color: #000000;">&#91;</span><span style="color: #000000;">3</span><span style="color: #000000;">&#93;</span>  SECTION  <span style="color: #ff0000;">"Language"</span>  ENTRY <span style="color: #ff0000;">"Scores"</span>          <span style="color: #0000ff;">OF</span> oInifile <span style="color: #00C800;">DEFAULT</span> <span style="color: #ff0000;">"Scores"</span><br />        <span style="color: #0000ff;">GET</span>  cLang<span style="color: #000000;">&#91;</span><span style="color: #000000;">4</span><span style="color: #000000;">&#93;</span>  SECTION  <span style="color: #ff0000;">"Language"</span>  ENTRY <span style="color: #ff0000;">"Select"</span>          <span style="color: #0000ff;">OF</span> oInifile <span style="color: #00C800;">DEFAULT</span> <span style="color: #ff0000;">"Select"</span><br />        <span style="color: #0000ff;">GET</span>  cLang<span style="color: #000000;">&#91;</span><span style="color: #000000;">5</span><span style="color: #000000;">&#93;</span>  SECTION  <span style="color: #ff0000;">"Language"</span>  ENTRY <span style="color: #ff0000;">"Player"</span>          <span style="color: #0000ff;">OF</span> oInifile <span style="color: #00C800;">DEFAULT</span> <span style="color: #ff0000;">"Player"</span><br />        <span style="color: #0000ff;">GET</span>  cLang<span style="color: #000000;">&#91;</span><span style="color: #000000;">6</span><span style="color: #000000;">&#93;</span>  SECTION  <span style="color: #ff0000;">"Language"</span>  ENTRY <span style="color: #ff0000;">"Training"</span>      <span style="color: #0000ff;">OF</span> oInifile <span style="color: #00C800;">DEFAULT</span> <span style="color: #ff0000;">"Training"</span><br />&nbsp; &nbsp; &nbsp; &nbsp; ...<br />&nbsp; &nbsp; &nbsp; &nbsp; ...<br />        <span style="color: #0000ff;">GET</span>  cLang<span style="color: #000000;">&#91;</span><span style="color: #000000;">14</span><span style="color: #000000;">&#93;</span>  SECTION  <span style="color: #ff0000;">"Language"</span> ENTRY <span style="color: #ff0000;">"There are missing"</span>   <span style="color: #0000ff;">OF</span> oInifile <span style="color: #00C800;">DEFAULT</span> <span style="color: #ff0000;">"There are missing"</span><br />    &nbsp; &nbsp; ...<br />&nbsp; &nbsp; &nbsp; &nbsp; ...<br />     ENDINI<br /><span style="color: #00C800;">ENDIF</span><br /><br /><span style="color: #00C800;">RETURN</span><span style="color: #000000;">&#40;</span> <span style="color: #00C800;">NIL</span> <span style="color: #000000;">&#41;</span><br /> </div>[/code:1ib7ffsf] [color=#FF0000:1ib7ffsf]5.[/color:1ib7ffsf] If not exist, create a new LANGUAGE.INI ( English ) [code=fw:1ib7ffsf]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">FUNCTION</span> SAVE_LANG<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">LOCAL</span> lSysini := .T., cIniFile := c_Path + <span style="color: #ff0000;">"<span style="color: #000000;">\L</span>ANGUAGE.INI"</span><br /><br />WritePProString<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Language"</span>, <span style="color: #ff0000;">"Game"</span>, <span style="color: #ff0000;">"Game"</span>,  cIniFile <span style="color: #000000;">&#41;</span><br />WritePProString<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Language"</span>, <span style="color: #ff0000;">"Trials"</span>, <span style="color: #ff0000;">"Trials"</span>,  cIniFile <span style="color: #000000;">&#41;</span> <br />WritePProString<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Language"</span>, <span style="color: #ff0000;">"Scores"</span>, <span style="color: #ff0000;">"Scores"</span>,  cIniFile <span style="color: #000000;">&#41;</span> <br />WritePProString<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Language"</span>, <span style="color: #ff0000;">"Select"</span>, <span style="color: #ff0000;">"Select"</span>,  cIniFile <span style="color: #000000;">&#41;</span> <br />WritePProString<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Language"</span>, <span style="color: #ff0000;">"Player"</span>, <span style="color: #ff0000;">"Player"</span>,  cIniFile <span style="color: #000000;">&#41;</span><br />WritePProString<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Language"</span>, <span style="color: #ff0000;">"Training"</span>, <span style="color: #ff0000;">"&Training"</span>,  cIniFile <span style="color: #000000;">&#41;</span> <br />WritePProString<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Language"</span>, <span style="color: #ff0000;">"Reset"</span>, <span style="color: #ff0000;">"Reset"</span>,  cIniFile <span style="color: #000000;">&#41;</span> <br />WritePProString<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Language"</span>, <span style="color: #ff0000;">"Config"</span>, <span style="color: #ff0000;">"Config"</span>,  cIniFile <span style="color: #000000;">&#41;</span> <br />WritePProString<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Language"</span>, <span style="color: #ff0000;">"Create"</span>, <span style="color: #ff0000;">"Create"</span>,  cIniFile <span style="color: #000000;">&#41;</span> <br />WritePProString<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Language"</span>, <span style="color: #ff0000;">"Show"</span>, <span style="color: #ff0000;">"Show"</span>,  cIniFile <span style="color: #000000;">&#41;</span> <br />WritePProString<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Language"</span>, <span style="color: #ff0000;">"Next"</span>, <span style="color: #ff0000;">"&Next"</span>,  cIniFile <span style="color: #000000;">&#41;</span> <br />...<br />...<br /><span style="color: #00C800;">RETURN</span><span style="color: #000000;">&#40;</span> <span style="color: #00C800;">NIL</span> <span style="color: #000000;">&#41;</span> <br /> </div>[/code:1ib7ffsf] Samples how to use : [color=#FF0000:1ib7ffsf]a) [/color:1ib7ffsf]Accelerator defined inside the PRG @ 25, 405 BTNBMP oBtnP[1] FILENAME c_path + "\System\Player1.bmp" ; SIZE 40, 45 OF oDlg1 PIXEL NOBORDER ; TOP ; PROMPT [color=#FF0000:1ib7ffsf]cLang[5][/color:1ib7ffsf] + " &1" ; FONT oTxtfont ; ACTION ( nAktPlayer := 1, SET_PLAYER() ) oBtnP[1]:cTooltip := [color=#FF0000:1ib7ffsf]cLang[4][/color:1ib7ffsf] + " 1." + [color=#FF0000:1ib7ffsf]cLang[5][/color:1ib7ffsf] oBtnP[1]:lTransparent := .T. oBtnP[1]:l2007 := .F. oBtnP[1]:SetColor( 128 ) [color=#FF0000:1ib7ffsf]b) [/color:1ib7ffsf]Accelerator defined inside the INI -- Keyword also used for Tooltipps using a Keyword from INI with a defined Accelerator for Tooltipps, You can use SUBSTR( @ 140, 455 BTNBMP oBtn[14] FILENAME c_path + "\System\Preview.bmp" ; SIZE 40, 45 OF oDlg1 PIXEL NOBORDER ; TOP ; PROMPT [color=#FF0000:1ib7ffsf]cLang[10][/color:1ib7ffsf] ; FONT oTxtfont ; ACTION ( lVISIBLE := .T., ; READ_GAME(), ; oBrw1:SetArray( aImg ), oBrw1:Refresh() ) oBtn[14]:cTooltip := [color=#FF0000:1ib7ffsf]cLang[10] + " " + cLang[1][/color:1ib7ffsf] oBtn[14]:lTransparent := .T. oBtn[14]:l2007 := .F. oBtn[14]:SetColor( 16312263 ) The Accelerator is defined inside the INI !!! Show=[color=#FF0000:1ib7ffsf]&Show[/color:1ib7ffsf] Copy the English LANGUAGE.INI to a new German.ini with defined Accelerators [Language] Game=[color=#FF0000:1ib7ffsf]&Spiel[/color:1ib7ffsf] Trials=[color=#FF0000:1ib7ffsf]&Versuche[/color:1ib7ffsf] Score=[color=#FF0000:1ib7ffsf]&Punkte[/color:1ib7ffsf] Select=[color=#FF0000:1ib7ffsf]&Auswahl[/color:1ib7ffsf] Player=[color=#FF0000:1ib7ffsf]Spie&ler[/color:1ib7ffsf] Training=[color=#FF0000:1ib7ffsf]T&raining[/color:1ib7ffsf] Reset=[color=#FF0000:1ib7ffsf]&zurücksetzen[/color:1ib7ffsf] ... ... Rename to LANGUAGE.INI Best Regards Uwe <!-- s:) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":)" title="Smile" /><!-- s:) -->
Adding a Multilanguage-solution to Your App.
Sorry BUT xharbour can have the multilanguage system it create on comilation file hil ot hit and you can call the language on your application using i18n() function you must first insert on your application the text with i18n() function : sample : DEFINE MSGITEM ::oMsgItem2; OF ::oWndMain:oMsgBar ; PROMPT ::cEmpresa ; SIZE 170 ; TOOLTIP " " + [b:2blyx16e]i18n("Company ")[/b:2blyx16e] + " " FONT ::oFontMsgItem then you must compile the prg with the parameter /J for sample /jit_IT.hil the compilator create a file hil with all words you insert on your app then on your app : HB_I18NSetLanguage( fcGetLang() ) .... MENUITEM i18n("Modifica la lingua") MENU MENUITEM i18n( "Seleziona la lingua" ) ; ACTION [b:2blyx16e]oApp():Idiomas()[/b:2blyx16e] MENUITEM i18n( "Modificare l'archivio della lingua" ); ACTION[b:2blyx16e] TLanguage():New() :Activar()[/b:2blyx16e] ENDMENU then you have Idiomas() and Tlanguage() Idiomas() is a function where you can select the file of the lang [img:2blyx16e]http&#58;//imageshack&#46;us/a/img690/6513/86148140&#46;png[/img:2blyx16e] Tlanguage() is a class where you can create another file from yout hil or change the words into the language you want : [img:2blyx16e]http&#58;//imageshack&#46;us/a/img705/8417/85568281&#46;png[/img:2blyx16e]
Adding a Multilanguage-solution to Your App.
for the sources i sad on prev topic i sent all to Antonio Linares Last year, it has never been taken as important and is not uncork never published in packages of fw. But i use current this for create Multilanguage application easy!!!!
Adding a Multilanguage-solution to Your App.
Silvio, Thank You for the Response. It sounds good. In my special Situation, I want to make it possible, ( not only a Translation ) also that the User can change the complete Text byhimself. Buttons,Resources... I finished with Testing and it works fine. Using just only 38 Words, it is OK. Best Regards Uwe <!-- s:lol: --><img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing" /><!-- s:lol: -->
Adding a Multilanguage-solution to Your App.
the problem is when you must translate many and many words I''m afraid a file ini with many and many words then it can result eating of resources my solution is easy and the final user can modify the language file creating himself
Adding a Multilanguage-solution to Your App.
Hello, I use a solution like i18n() function, but with ini files, it work perfect for SAY, Buttons, Title, menu, anywhere. Exemple ini file: [ESP] DESCRIP=Español ||~AMPA32, G~|estió de |~F~|acturacions de l'|~AMPA (~|domiciliacions, famílies, pares, alumnes, rebuts)|=|AMPA32, Gestión de Facturaciones de la AMPA (domiciliaciones, families, padres, alumnos, recibos)| | |~F~|itxers &|~M~|estres|=| Ficheros &Maestros| |&|~F~|amílies |~AMPA|=|&Familias AMPA| |&|~P~|ares/|~M~|ares|=|&Padres/Madres| |&|~A~|lumnes|=|&Alumnos| Exemple in SAY: @ 25,15 SAY GetTrad( "Alumnes:" ) OF oAlumne01 COLORS J02CLRTEXTO,J02CLRFONDO FONT ; J02FONTSAY PIXEL SIZE 120,16 Regards,
Adding a pullldown menu at runtime.
Hi all, I was able to add a menu item in the system menu that was created in the resource file at runtime. My next task requires to add a pulldown menu at runtime. Is it posible? How? Many thanks!
Adding a pullldown menu at runtime.
Have a look at TMenu:Add() or TMenu:Insert() methods. EMG
Adding a pullldown menu at runtime.
Got it. Regards!
Adding a real time character count to a memo field dialog bx
To All I would like to be able to show a "real time" character count when you start typing a memo field .. I have some long string text fields that I have to make sure the character count does not exceed the maximum table field length .. The reason I want to enforce a strict field limit is the text will eventually fit into an program generated e-mail. I do not want someone writing a 1000 char message that I have to format in a limited space to fit into an e-mail .. hence why I use a fixed length char() field. Here is my code .. the Table field is a Sql char(200) or char(400) text field ( nlen parameter ) .. again, I do not want an unlimited Sql "Text" field .. [code=fw:28sgwix2]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oUSERS <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"MEMO"</span> ;<br />       <span style="color: #0000ff;">TITLE</span> cTITLE              ;<br /><br />cSay1 := <span style="color: #ff0000;">"Maximum "</span>+alltrim<span style="color: #000000;">&#40;</span>str<span style="color: #000000;">&#40;</span>nLen<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>+<span style="color: #ff0000;">" Charactors"</span><br /><span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">SAY</span> oSay1 <span style="color: #0000ff;">var</span> cSay1 <span style="color: #0000ff;">ID</span> <span style="color: #000000;">195</span> <span style="color: #0000ff;">of</span> oUsers <span style="color: #0000ff;">UPDATE</span><br />oSay1:<span style="color: #000000;">SetColor</span><span style="color: #000000;">&#40;</span>nRgb<span style="color: #000000;">&#40;</span><span style="color: #000000;">7</span>,<span style="color: #000000;">7</span>,<span style="color: #000000;">224</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">IF</span> cMODE = <span style="color: #ff0000;">"E"</span> .or. cMode = <span style="color: #ff0000;">"P"</span><br /><br />   <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">GET</span> oMEMO      <span style="color: #0000ff;">VAR</span> cMEMO MEMO <span style="color: #0000ff;">ID</span> <span style="color: #000000;">130</span> <span style="color: #0000ff;">of</span> oUSERS <span style="color: #0000ff;">UPDATE</span><br /><br /><span style="color: #00C800;">ELSE</span>     <span style="color: #B900B9;">// view</span><br /><br />   <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">GET</span> oMEMO      <span style="color: #0000ff;">VAR</span> cMEMO MEMO <span style="color: #0000ff;">ID</span> <span style="color: #000000;">130</span> <span style="color: #0000ff;">of</span> oUSERS <span style="color: #0000ff;">COLOR</span> CLR_BLACK, <span style="color: #000000;">16053492</span> READONLY<br /><br /><span style="color: #00C800;">ENDIF</span><br /><br /><br />          oMemo:<span style="color: #000000;">bGotFocus</span> = <span style="color: #000000;">&#123;</span> || oMemo:<span style="color: #000000;">SetSel</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span>,;<br />                         oMemo:<span style="color: #000000;">Goto</span><span style="color: #000000;">&#40;</span> oMemo:<span style="color: #000000;">GetLineCount</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>,;<br />                         __Keyboard<span style="color: #000000;">&#40;</span> Chr<span style="color: #000000;">&#40;</span> VK_HOME <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />   <br /><span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">BTNBMP</span> oButt1 <span style="color: #0000ff;">ID</span> <span style="color: #000000;">111</span> ;     <span style="color: #B900B9;">// ok</span><br />         <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"Ok"</span> ;<br />         <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Save"</span> <span style="color: #0000ff;">LEFT</span> <span style="color: #000000;">2007</span>;<br />         <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span>lOK := _Doit1<span style="color: #000000;">&#40;</span>oRsTrav, @cMEMO, nLEN, oMEMO, cMODE, cButton <span style="color: #000000;">&#41;</span>, ;<br />                 <span style="color: #00C800;">IF</span><span style="color: #000000;">&#40;</span> lOK = .T., <span style="color: #000000;">&#40;</span> oUSERS:<span style="color: #000000;">END</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, oBtn1:<span style="color: #000000;">Enable</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> ,<span style="color: #000000;">&#41;</span>  <span style="color: #000000;">&#41;</span>;      <br />         GRADIENT GreyButtonGrad<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">BTNBMP</span> oButt2 <span style="color: #0000ff;">ID</span> <span style="color: #000000;">112</span> ;     <span style="color: #B900B9;">// cancel</span><br />         <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"CANCEL"</span> ;<br />         <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Cancel"</span> <span style="color: #0000ff;">LEFT</span> <span style="color: #000000;">2007</span>;<br />         <span style="color: #0000ff;">ACTION</span> oUSERS:<span style="color: #000000;">END</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;<br />         GRADIENT GreyButtonGrad<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oUSERS ;<br />         <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span> <span style="color: #000000;">&#40;</span><span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> cMode = <span style="color: #ff0000;">"V"</span>, oButt1:<span style="color: #000000;">Disable</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, <span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> ;<br />         <span style="color: #0000ff;">VALID</span> <span style="color: #000000;">&#40;</span>!GETKEYSTATE<span style="color: #000000;">&#40;</span> <span style="color: #000000;">27</span> <span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>  <span style="color: #B900B9;">// do not allow esc key here</span><br /><br /><span style="color: #00C800;">If</span> cMode = <span style="color: #ff0000;">"V"</span><br /><span style="color: #00C800;">Else</span><br /><br />   oBtn1:<span style="color: #000000;">Enable</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   cDesignation := cMemo<br /><br />   SysReFresh<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">Endif</span><br /><br /><br />oBtn2:<span style="color: #000000;">Enable</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />oBtn3:<span style="color: #000000;">Enable</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">RETURN</span><span style="color: #000000;">&#40;</span> <span style="color: #00C800;">NIL</span> <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #B900B9;">//-----------------------------</span><br /><span style="color: #B900B9;">// this function counts the number of characters in the memo string and warns if the length is >= to nLen</span><br /><br /><span style="color: #00C800;">Static</span> FUNC _Doit1<span style="color: #000000;">&#40;</span> oRs, cMEMO, nLEN, oMEMO, cMODE, cButton <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">LOCAL</span> SAYING, nLENGTH, nSel<br /><br /><span style="color: #00C800;">IF</span> cMODE = <span style="color: #ff0000;">'V'</span><br />   <span style="color: #00C800;">RETURN</span><span style="color: #000000;">&#40;</span>.T.<span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">ENDIF</span><br /><br />cMEMO    := ALLTRIM<span style="color: #000000;">&#40;</span> cMEMO <span style="color: #000000;">&#41;</span><br />nLENGTH  := LEN<span style="color: #000000;">&#40;</span> cMEMO <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">IF</span> xWRITE = <span style="color: #ff0000;">"Y"</span> .or. xSUPER = <span style="color: #ff0000;">"Y"</span> .or. xADMIN = <span style="color: #ff0000;">'Y'</span><br /><br />   <span style="color: #00C800;">IF</span> nLENGTH > nLEN<br /><br />      StandardGrad<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />      SAYING := <span style="color: #ff0000;">"WARNING .. your text is "</span>+alltrim<span style="color: #000000;">&#40;</span>STR<span style="color: #000000;">&#40;</span>nLENGTH<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>+<span style="color: #ff0000;">" charactors"</span>+CRLF<br />      SAYING += <span style="color: #ff0000;">"and the Database Table will only hold "</span>+alltrim<span style="color: #000000;">&#40;</span>str<span style="color: #000000;">&#40;</span>nLen<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>+<span style="color: #ff0000;">" charactors"</span>+CRLF<br /><br />      nSel := Alert<span style="color: #000000;">&#40;</span> Saying ,;<br />                    <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"Return and Make Changes"</span>, <span style="color: #ff0000;">"Truncate Text to "</span>+alltrim<span style="color: #000000;">&#40;</span>STR<span style="color: #000000;">&#40;</span>nLEN<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>+<span style="color: #ff0000;">" Charactors"</span> <span style="color: #000000;">&#125;</span><span style="color: #000000;">&#41;</span><br /><br />      <span style="color: #00C800;">Do</span> <span style="color: #00C800;">Case</span><br />      <span style="color: #00C800;">Case</span> nSel = <span style="color: #000000;">1</span><br />         oMemo:<span style="color: #000000;">Setfocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />         SysReFresh<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />         <span style="color: #00C800;">Return</span><span style="color: #000000;">&#40;</span>.f.<span style="color: #000000;">&#41;</span><br />      <span style="color: #00C800;">Case</span> nSel = <span style="color: #000000;">2</span><br />         cMEMO := <span style="color: #0000ff;">SUBSTR</span><span style="color: #000000;">&#40;</span> cMEMO,<span style="color: #000000;">1</span>,nLEN <span style="color: #000000;">&#41;</span><br />         oMemo:<span style="color: #0000ff;">ReFresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />         oMemo:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />         SysReFresh<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />         <span style="color: #00C800;">Return</span><span style="color: #000000;">&#40;</span>.f.<span style="color: #000000;">&#41;</span><br />      <span style="color: #00C800;">OtherWIse</span><br />         cMEMO := <span style="color: #0000ff;">SUBSTR</span><span style="color: #000000;">&#40;</span> cMEMO,<span style="color: #000000;">1</span>,nLEN <span style="color: #000000;">&#41;</span><br />         oMemo:<span style="color: #0000ff;">ReFresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />         oMemo:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />         SysReFresh<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />         <span style="color: #00C800;">Return</span><span style="color: #000000;">&#40;</span>.f.<span style="color: #000000;">&#41;</span><br />      <span style="color: #00C800;">ENdCase</span><br /><br />   <span style="color: #00C800;">ENDIF</span><br /><br /><span style="color: #00C800;">ENDIF</span><br /><br /><span style="color: #00C800;">RETURN</span><span style="color: #000000;">&#40;</span>.T.<span style="color: #000000;">&#41;</span><br /><br /> </div>[/code:28sgwix2] What I would like to do is add a counter field to the diablg box to show the number of characters being typed in real time ?? Thanks Rick Lipkin
Adding a real time character count to a memo field dialog bx
This is a sample with counter and limited text to 100 chars: [code=fw:2q8vhvz8]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"Fivewin.ch"</span><br /><br /><br /><span style="color: #00D7D7;">#define</span> EM_LIMITTEXT <span style="color: #000000;">197</span><br /><br /><br /><span style="color: #00C800;">FUNCTION</span> MAIN<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; <span style="color: #00C800;">LOCAL</span> oDlg<br /><br />&nbsp; &nbsp; <span style="color: #00C800;">LOCAL</span> oGet, cVar := <span style="color: #ff0000;">""</span><br /><br />&nbsp; &nbsp; <span style="color: #00C800;">LOCAL</span> oSay<br /><br />&nbsp; &nbsp; <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg<br /><br />&nbsp; &nbsp; @ <span style="color: #000000;">1</span>, <span style="color: #000000;">1</span> <span style="color: #0000ff;">GET</span> oGet <span style="color: #0000ff;">VAR</span> cVar MEMO;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">100</span>, <span style="color: #000000;">30</span><br /><br />&nbsp; &nbsp; oGet:<span style="color: #000000;">bKeyDown</span> = <span style="color: #000000;">&#123;</span> || SysRefresh<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, oSay:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span> .F. <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br /><br />&nbsp; &nbsp; @ <span style="color: #000000;">3</span>, <span style="color: #000000;">1</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">"&Close"</span> <span style="color: #0000ff;">ACTION</span> oDlg:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; @ <span style="color: #000000;">3</span>, <span style="color: #000000;">10</span> <span style="color: #0000ff;">SAY</span> oSay <span style="color: #0000ff;">PROMPT</span> STR<span style="color: #000000;">&#40;</span> LEN<span style="color: #000000;">&#40;</span> cVar <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span> oGet:<span style="color: #000000;">SendMsg</span><span style="color: #000000;">&#40;</span> EM_LIMITTEXT, <span style="color: #000000;">100</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">CENTER</span><br /><br />&nbsp; &nbsp; <span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span></div>[/code:2q8vhvz8] EMG
Adding a real time character count to a memo field dialog bx
Maybe like this. [code=fw:11plfhdq]<div class="fw" id="{CB}" style="font-family: monospace;">    @ <span style="color: #000000;">50</span>,<span style="color: #000000;">10</span> <span style="color: #0000ff;">SAY</span> oSay <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Mesaj"</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">PIXEL</span> <br />    @ <span style="color: #000000;">48</span>,<span style="color: #000000;">40</span> <span style="color: #0000ff;">GET</span> oGovde <span style="color: #0000ff;">VAR</span> Govde <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">110</span>,<span style="color: #000000;">10</span> <span style="color: #0000ff;">UPDATE</span> MEMO ;<br />            <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">CHANGE</span> <span style="color: #000000;">&#40;</span>oSayac:<span style="color: #000000;">VarPut</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"("</span>+NTRIM<span style="color: #000000;">&#40;</span>LEN<span style="color: #000000;">&#40;</span>oGovde:<span style="color: #000000;">GetText</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>+<span style="color: #ff0000;">")"</span><span style="color: #000000;">&#41;</span>,;<br />                oSayac:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />    <br />    @ <span style="color: #000000;">62</span>,<span style="color: #000000;">10</span> <span style="color: #0000ff;">SAY</span> oSayac <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"(Bo?)"</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">30</span>,<span style="color: #000000;">10</span><br />   </div>[/code:11plfhdq]
Adding a real time character count to a memo field dialog bx
Enrico Thank you for your responce .. been a while since we had a chance to chat ... I am having difficulty translating your code into using resources .. this is my current code .. I can get it to initially come up but when I click on the get field .. the code blows up .. [code=fw:1pswagif]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #B900B9;">//------------------------------------</span><br /><span style="color: #00C800;">Static</span> FUNC _ViewMemo4<span style="color: #000000;">&#40;</span> cMODE, oRsTrav, cTABLENAME, oBtn1,oBtn2,oBtn3,oBtn4,oBtn5,cButton,cBenefits,nLen,cPrevAppr <span style="color: #000000;">&#41;</span>       <span style="color: #B900B9;">// benefits button</span><br /><br /><span style="color: #00D7D7;">#define</span> EM_LIMITTEXT <span style="color: #000000;">197</span><br /><br /><span style="color: #00C800;">LOCAL</span> SAYING, oUSERS, cTITLE, oMEMO, cMEMO<br /><span style="color: #00C800;">LOCAL</span> lOK, oButt1,oButt2<br /><br /><span style="color: #00C800;">Local</span> oSay1,cSay1<br /><span style="color: #00C800;">Local</span> oSay<br /><br /><span style="color: #00C800;">IF</span> EMPTY<span style="color: #000000;">&#40;</span> cMODE <span style="color: #000000;">&#41;</span><br />   cMODE := <span style="color: #ff0000;">"V"</span><br /><span style="color: #00C800;">ENDIF</span><br /><br /><span style="color: #00C800;">IF</span> xWRITE = <span style="color: #ff0000;">"Y"</span> .or. xSUPER = <span style="color: #ff0000;">"Y"</span> .or. xADMIN = <span style="color: #ff0000;">'Y'</span><br /><span style="color: #00C800;">ELSE</span><br />   cMODE := <span style="color: #ff0000;">"V"</span><br /><span style="color: #00C800;">ENDIF</span><br /><br /><span style="color: #00C800;">IF</span> oRsTrav:<span style="color: #000000;">eof</span><br />   SAYING := <span style="color: #ff0000;">"SORRY ... Before you can Write a Memo "</span><br />   SAYING += <span style="color: #ff0000;">"a Record must Already Exist"</span><br />   <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">&#40;</span> SAYING <span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">RETURN</span><span style="color: #000000;">&#40;</span> .F. <span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">ENDIF</span><br /><br />oBtn1:<span style="color: #000000;">Disable</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />oBtn2:<span style="color: #000000;">Disable</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />oBtn3:<span style="color: #000000;">Disable</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />LightGreyGrad<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">DO</span> <span style="color: #00C800;">CASE</span><br /><span style="color: #00C800;">CASE</span> cMODE = <span style="color: #ff0000;">"A"</span><br />   cTitle := cTABLENAME+<span style="color: #ff0000;">" Table Memo for     'Purpose or Benefits Text'     ADD"</span><br />   cMEMO := space<span style="color: #000000;">&#40;</span>nlen<span style="color: #000000;">&#41;</span>    <span style="color: #B900B9;">// 200</span><br /><br /><span style="color: #00C800;">CASE</span> cMODE = <span style="color: #ff0000;">"E"</span><br />   cTitle := cTABLENAME+<span style="color: #ff0000;">" Table Memo for     'Purpose or Benefits Text'     EDIT"</span><br />   cMemo := cBenefits<br /><br /><span style="color: #00C800;">CASE</span> cMODE = <span style="color: #ff0000;">"V"</span><br />   cTitle := cTABLENAME+<span style="color: #ff0000;">" Table Memo for     'Purpose or Benefits Text'     VIEW"</span><br />   cMEMO := oRsTrav:<span style="color: #000000;">Fields</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"Benefits"</span><span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Value</span><br /><br /><span style="color: #00C800;">CASE</span> cMODE = <span style="color: #ff0000;">"P"</span><br />   cTITLE := cTABLENAME+<span style="color: #ff0000;">" Table Memo     Approval Info VIEW"</span><br />   cMEMO := oRsTrav:<span style="color: #000000;">Fields</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"Benefits"</span><span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Value</span><br /><br /><span style="color: #00C800;">ENDCASE</span><br /><br /><span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oUSERS <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"MEMO"</span> ;<br />       <span style="color: #0000ff;">TITLE</span> cTITLE              ;<br /><br />     cSay1 := <span style="color: #ff0000;">"Maximum "</span>+alltrim<span style="color: #000000;">&#40;</span>str<span style="color: #000000;">&#40;</span>nLen<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>+<span style="color: #ff0000;">" Charactors"</span><br />     <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">SAY</span> oSay1 <span style="color: #0000ff;">var</span> cSay1 <span style="color: #0000ff;">ID</span> <span style="color: #000000;">195</span> <span style="color: #0000ff;">of</span> oUsers <span style="color: #0000ff;">UPDATE</span><br />     oSay1:<span style="color: #000000;">SetColor</span><span style="color: #000000;">&#40;</span>nRgb<span style="color: #000000;">&#40;</span><span style="color: #000000;">7</span>,<span style="color: #000000;">7</span>,<span style="color: #000000;">224</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br /><br />     <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">SAY</span> oSay <span style="color: #0000ff;">PROMPT</span> Str<span style="color: #000000;">&#40;</span>len<span style="color: #000000;">&#40;</span>cMemo<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> <span style="color: #0000ff;">ID</span> <span style="color: #000000;">196</span> <span style="color: #0000ff;">of</span> oUsers <span style="color: #B900B9;">//UPDATE</span><br /><br />     <span style="color: #00C800;">IF</span> cMODE = <span style="color: #ff0000;">"E"</span> .or. cMode = <span style="color: #ff0000;">"P"</span><br /><br />        <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">GET</span> oMEMO      <span style="color: #0000ff;">VAR</span> cMEMO MEMO <span style="color: #0000ff;">ID</span> <span style="color: #000000;">130</span> <span style="color: #0000ff;">of</span> oUSERS <span style="color: #0000ff;">UPDATE</span><br /><br />     <span style="color: #00C800;">ELSE</span>     <span style="color: #B900B9;">// view</span><br /><br />        <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">GET</span> oMEMO      <span style="color: #0000ff;">VAR</span> cMEMO MEMO <span style="color: #0000ff;">ID</span> <span style="color: #000000;">130</span> <span style="color: #0000ff;">of</span> oUSERS <span style="color: #0000ff;">COLOR</span> CLR_BLACK, <span style="color: #000000;">16053492</span> READONLY<br /><br />    <span style="color: #00C800;">ENDIF</span><br /><br />  *  oMemo:<span style="color: #000000;">bGotFocus</span> = <span style="color: #000000;">&#123;</span> || oMemo:<span style="color: #000000;">SetSel</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span>,;                           <span style="color: #B900B9;">// blows up had to rem'd out</span><br />  *                        oMemo:<span style="color: #000000;">Goto</span><span style="color: #000000;">&#40;</span> oMemo:<span style="color: #000000;">GetLineCount</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>,;<br />  *                       __Keyboard<span style="color: #000000;">&#40;</span> Chr<span style="color: #000000;">&#40;</span> VK_HOME <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br /><br />    oMemo:<span style="color: #000000;">bKeyDown</span> = <span style="color: #000000;">&#123;</span> SysReFresh<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, oSay:<span style="color: #0000ff;">ReFresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <span style="color: #B900B9;">// .f. ) }</span><br /><br /><br />    <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">BTNBMP</span> oButt1 <span style="color: #0000ff;">ID</span> <span style="color: #000000;">111</span> ;     <span style="color: #B900B9;">// ok</span><br />         <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"Ok"</span> ;<br />         <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Save"</span> <span style="color: #0000ff;">LEFT</span> <span style="color: #000000;">2007</span>;<br />         <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span>lOK := _Doit1<span style="color: #000000;">&#40;</span>oRsTrav, @cMEMO, nLEN, oMEMO, cMODE, cButton <span style="color: #000000;">&#41;</span>, ;<br />                 <span style="color: #00C800;">IF</span><span style="color: #000000;">&#40;</span> lOK = .T., <span style="color: #000000;">&#40;</span> oUSERS:<span style="color: #000000;">END</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, oBtn1:<span style="color: #000000;">Enable</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> ,<span style="color: #000000;">&#41;</span>  <span style="color: #000000;">&#41;</span>;<br />         GRADIENT GreyButtonGrad<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />    <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">BTNBMP</span> oButt2 <span style="color: #0000ff;">ID</span> <span style="color: #000000;">112</span> ;     <span style="color: #B900B9;">// cancel</span><br />         <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"CANCEL"</span> ;<br />         <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Cancel"</span> <span style="color: #0000ff;">LEFT</span> <span style="color: #000000;">2007</span>;<br />         <span style="color: #0000ff;">ACTION</span> oUSERS:<span style="color: #000000;">END</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;<br />         GRADIENT GreyButtonGrad<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oUSERS ;<br />         <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span> <span style="color: #000000;">&#40;</span>oMemo:<span style="color: #000000;">SendMsg</span><span style="color: #000000;">&#40;</span> EM_LIMITTEXT,<span style="color: #000000;">100</span>,<span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span>,<span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> cMode = <span style="color: #ff0000;">"V"</span>, oButt1:<span style="color: #000000;">Disable</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, <span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> ;<br />         <span style="color: #0000ff;">VALID</span> <span style="color: #000000;">&#40;</span>!GETKEYSTATE<span style="color: #000000;">&#40;</span> <span style="color: #000000;">27</span> <span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>  <span style="color: #B900B9;">// do not allow esc key here</span><br /><br /><span style="color: #00C800;">If</span> cMode = <span style="color: #ff0000;">"V"</span><br /><span style="color: #00C800;">Else</span><br /><br />   oBtn1:<span style="color: #000000;">Enable</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   cBenefits := cMemo<br /><br />   SysReFresh<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">Endif</span><br /><br /><br />oBtn2:<span style="color: #000000;">Enable</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />oBtn3:<span style="color: #000000;">Enable</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">RETURN</span><span style="color: #000000;">&#40;</span> <span style="color: #00C800;">NIL</span> <span style="color: #000000;">&#41;</span><br /><br /> </div>[/code:1pswagif] Here is Memo.rc [code=fw:1pswagif]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #B900B9;">// Generated by ResEdit 1.6.6</span><br /><span style="color: #B900B9;">// Copyright (C) 2006-2015</span><br /><span style="color: #B900B9;">// <!-- m --><a class="postlink" href="http://www.resedit.net">http://www.resedit.net</a><!-- m --></span><br /><br /><span style="color: #00D7D7;">#include</span> <windows.h><br /><span style="color: #00D7D7;">#include</span> <commctrl.h><br /><span style="color: #B900B9;">//#include "resource.h"</span><br /><br />#ifndef WC_STATIC<br /><span style="color: #00D7D7;">#define</span> WC_STATIC L<span style="color: #ff0000;">"Static"</span><br />#endif<br /><br />#ifndef MONTHCAL_CLASS<br /><span style="color: #00D7D7;">#define</span> MONTHCAL_CLASS <span style="color: #ff0000;">"SysMonthCal32"</span><br />#endif<br /><br />#ifndef DATETIMEPICK_CLASS<br /><span style="color: #00D7D7;">#define</span> DATETIMEPICK_CLASS <span style="color: #ff0000;">"SysDateTimePick32"</span><br />#endif<br /><br /><span style="color: #B900B9;">//</span><br /><span style="color: #B900B9;">// Dialog resources</span><br /><span style="color: #B900B9;">//</span><br />LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL<br />MEMO <span style="color: #0000ff;">DIALOG</span> <span style="color: #000000;">150</span>, <span style="color: #000000;">47</span>, <span style="color: #000000;">353</span>, <span style="color: #000000;">135</span><br /><span style="color: #0000ff;">STYLE</span> DS_MODALFRAME | DS_SETFONT | WS_CAPTION | WS_POPUP<br /><span style="color: #0000ff;">FONT</span> <span style="color: #000000;">6</span>, <span style="color: #ff0000;">"MS Sans Serif"</span><br /><span style="color: #000000;">&#123;</span><br />    EDITTEXT        <span style="color: #000000;">196</span>, <span style="color: #000000;">107</span>, <span style="color: #000000;">102</span>, <span style="color: #000000;">25</span>, <span style="color: #000000;">12</span>, WS_DISABLED, WS_EX_LEFT<br />    LTEXT           <span style="color: #ff0000;">"Max 400 char"</span>, <span style="color: #000000;">195</span>, <span style="color: #000000;">4</span>, <span style="color: #000000;">103</span>, <span style="color: #000000;">95</span>, <span style="color: #000000;">9</span>, SS_LEFT | SS_NOPREFIX, WS_EX_LEFT<br />    EDITTEXT        <span style="color: #000000;">130</span>, <span style="color: #000000;">40</span>, <span style="color: #000000;">8</span>, <span style="color: #000000;">307</span>, <span style="color: #000000;">80</span>, WS_VSCROLL | ES_MULTILINE | ES_WANTRETURN, WS_EX_LEFT<br />    CONTROL         <span style="color: #ff0000;">"Ok"</span>, <span style="color: #000000;">111</span>, <span style="color: #ff0000;">"TBtnBmp"</span>, 0x50010020, <span style="color: #000000;">247</span>, <span style="color: #000000;">100</span>, <span style="color: #000000;">45</span>, <span style="color: #000000;">24</span>, 0x00000000<br />    LTEXT           <span style="color: #ff0000;">"Memo"</span>, <span style="color: #000000;">194</span>, <span style="color: #000000;">3</span>, <span style="color: #000000;">11</span>, <span style="color: #000000;">35</span>, <span style="color: #000000;">9</span>, SS_LEFT | SS_NOPREFIX, WS_EX_LEFT<br />    CONTROL         <span style="color: #ff0000;">"Cancel"</span>, <span style="color: #000000;">112</span>, <span style="color: #ff0000;">"TBtnBmp"</span>, 0x50010020, <span style="color: #000000;">300</span>, <span style="color: #000000;">100</span>, <span style="color: #000000;">45</span>, <span style="color: #000000;">24</span>, 0x00000000<br /><span style="color: #000000;">&#125;</span><br /><br /> </div>[/code:1pswagif] Passing the variable cBenefits which I initializes cMemo .. from there I have tried to interpret your code and failed .. [code=fw:1pswagif]<div class="fw" id="{CB}" style="font-family: monospace;"><br />Application<br />===========<br />   Path and <span style="color: #0000ff;">name</span>: <span style="color: #000000;">C</span>:\Fox\DOI\LeavTrav\LeaveW32.Exe <span style="color: #000000;">&#40;</span><span style="color: #000000;">32</span> bits<span style="color: #000000;">&#41;</span><br />   <span style="color: #0000ff;">Size</span>: <span style="color: #000000;">6</span>,<span style="color: #000000;">641</span>,<span style="color: #000000;">664</span> bytes<br />   Compiler version: <span style="color: #000000;">xHarbour</span> <span style="color: #000000;">1.2</span><span style="color: #000000;">.3</span> Intl. <span style="color: #000000;">&#40;</span>SimpLex<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#40;</span>Build <span style="color: #000000;">20200311</span><span style="color: #000000;">&#41;</span><br />   FiveWin  version: <span style="color: #000000;">FWH</span> <span style="color: #000000;">20.06</span><br />   C compiler version: <span style="color: #000000;">Borland</span>/Embarcadero C++ <span style="color: #000000;">7.4</span> <span style="color: #000000;">&#40;</span><span style="color: #000000;">32</span>-bit<span style="color: #000000;">&#41;</span><br />   Windows version: <span style="color: #000000;">6.2</span>, Build <span style="color: #000000;">9200</span> <br /><br />   Time <span style="color: #0000ff;">from</span> start: <span style="color: #000000;">0</span> hours <span style="color: #000000;">0</span> mins <span style="color: #000000;">14</span> secs <br />   Error occurred <span style="color: #00C800;">at</span>: <span style="color: #000000;">07</span>/<span style="color: #000000;">20</span>/<span style="color: #000000;">2020</span>, <span style="color: #000000;">14</span>:<span style="color: #000000;">09</span>:<span style="color: #000000;">54</span><br />   Error description: <span style="color: #000000;">Error</span> BASE/<span style="color: #000000;">1004</span>  <span style="color: #00C800;">Class</span>: <span style="color: #ff0000;">'ARRAY'</span> has no exported <span style="color: #00C800;">method</span>: <span style="color: #000000;">EVAL</span><br />   Args:<br />     <span style="color: #000000;">&#91;</span>   <span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span> = A   <span style="color: #000000;">&#123;</span> ... <span style="color: #000000;">&#125;</span> length: <span style="color: #000000;">2</span><br />     <span style="color: #000000;">&#91;</span>   <span style="color: #000000;">2</span><span style="color: #000000;">&#93;</span> = N   <span style="color: #000000;">75</span><br />     <span style="color: #000000;">&#91;</span>   <span style="color: #000000;">3</span><span style="color: #000000;">&#93;</span> = N   <span style="color: #000000;">2424833</span><br />     <span style="color: #000000;">&#91;</span>   <span style="color: #000000;">4</span><span style="color: #000000;">&#93;</span> = O   TMULTIGET<br /><br />Stack Calls<br />===========<br />   Called <span style="color: #0000ff;">from</span>:  => EVAL<span style="color: #000000;">&#40;</span> <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span><br />   Called <span style="color: #0000ff;">from</span>: .\source\classes\<span style="color: #0000ff;">WINDOW</span>.PRG => TWINDOW:<span style="color: #000000;">KEYDOWN</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">2867</span> <span style="color: #000000;">&#41;</span><br />   Called <span style="color: #0000ff;">from</span>: .\source\classes\CONTROL.PRG => TCONTROL:<span style="color: #000000;">KEYDOWN</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">1114</span> <span style="color: #000000;">&#41;</span><br />   Called <span style="color: #0000ff;">from</span>: .\source\classes\MGET.PRG => TMULTIGET:<span style="color: #000000;">KEYDOWN</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">661</span> <span style="color: #000000;">&#41;</span><br />   Called <span style="color: #0000ff;">from</span>:  => TWINDOW:<span style="color: #000000;">HANDLEEVENT</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span><br />   Called <span style="color: #0000ff;">from</span>: .\source\classes\CONTROL.PRG => TMULTIGET:<span style="color: #000000;">HANDLEEVENT</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">1827</span> <span style="color: #000000;">&#41;</span><br />   Called <span style="color: #0000ff;">from</span>: .\source\classes\<span style="color: #0000ff;">WINDOW</span>.PRG => _FWH<span style="color: #000000;">&#40;</span> <span style="color: #000000;">3559</span> <span style="color: #000000;">&#41;</span><br />   Called <span style="color: #0000ff;">from</span>:  => DIALOGBOX<span style="color: #000000;">&#40;</span> <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span><br />   Called <span style="color: #0000ff;">from</span>: .\source\classes\<span style="color: #0000ff;">DIALOG</span>.PRG => TDIALOG:<span style="color: #0000ff;">ACTIVATE</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">304</span> <span style="color: #000000;">&#41;</span><br />   Called <span style="color: #0000ff;">from</span>: <span style="color: #000000;">REQUEST</span>.PRG => _VIEWMEMO4<span style="color: #000000;">&#40;</span> <span style="color: #000000;">4035</span> <span style="color: #000000;">&#41;</span><br />   Called <span style="color: #0000ff;">from</span>: <span style="color: #000000;">REQUEST</span>.PRG => <span style="color: #000000;">&#40;</span>b<span style="color: #000000;">&#41;</span>_REQUEST<span style="color: #000000;">&#40;</span> <span style="color: #000000;">1447</span> <span style="color: #000000;">&#41;</span><br /> </div>[/code:1pswagif] Appreciate any suggestions ... Thanks Rick Lipkin
Adding a real time character count to a memo field dialog bx
Sorry, I can't help you without a sample that I can compile and run here. EMG
Adding a real time character count to a memo field dialog bx
Enrico Try this code ... I get an initial value .. of 179 .. but the len of cMemo is not updated as you type in more charactors .. Thanks Rick [code=fw:3kjp4f4z]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"Fivewin.ch"</span><br /><span style="color: #00D7D7;">#define</span> EM_LIMITTEXT <span style="color: #000000;">197</span><br /><br /><br /><span style="color: #00C800;">FUNCTION</span> MAIN<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">LOCAL</span> oDlg<br /><span style="color: #00C800;">LOCAL</span> cMemo, oMemo, cTitle<br /><span style="color: #00C800;">LOCAL</span> oSay,cSay<br /><br /><br /><br />cMemo := <span style="color: #ff0000;">"Many years experience with and a good understanding of IP networking, IP printing, SMTP "</span><br />cMemo += <span style="color: #ff0000;">"routing for multi-function printers, scanners, copiers and general configurations of Cisco "</span><br /><br />cTITLE := <span style="color: #ff0000;">"Request Table Memo for     'Travel Rejection Text'    EDIT"</span><br />cSay   := <span style="color: #ff0000;">"Number of Charactors Typed"</span><br /><br /><br /><span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"MEMO"</span> ;<br />       <span style="color: #0000ff;">TITLE</span> cTITLE<br /><br />       <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">GET</span> oMemo <span style="color: #0000ff;">VAR</span> cMEMO MEMO <span style="color: #0000ff;">ID</span> <span style="color: #000000;">130</span> <span style="color: #0000ff;">of</span> oDlg <span style="color: #0000ff;">UPDATE</span><br /><br />       oMemo:<span style="color: #000000;">bGotFocus</span> = <span style="color: #000000;">&#123;</span> || oMemo:<span style="color: #000000;">SetSel</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span>,;<br />                         oMemo:<span style="color: #000000;">Goto</span><span style="color: #000000;">&#40;</span> oMemo:<span style="color: #000000;">GetLineCount</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>,;<br />                         __Keyboard<span style="color: #000000;">&#40;</span> Chr<span style="color: #000000;">&#40;</span> VK_HOME <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br /><br />       <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">SAY</span> oSay <span style="color: #0000ff;">VAR</span> str<span style="color: #000000;">&#40;</span>len<span style="color: #000000;">&#40;</span>cMemo<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> <span style="color: #0000ff;">ID</span> <span style="color: #000000;">196</span> <span style="color: #0000ff;">of</span> oDlg <span style="color: #0000ff;">UPDATE</span><br /><br />       <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">BTNBMP</span> oButt1 <span style="color: #0000ff;">ID</span> <span style="color: #000000;">111</span> ;     <span style="color: #B900B9;">// ok</span><br />         <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"Ok"</span> ;<br />         <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Save"</span> <span style="color: #0000ff;">LEFT</span> <span style="color: #000000;">2007</span>;<br />         <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> oDlg:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />       <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">BTNBMP</span> oButt2 <span style="color: #0000ff;">ID</span> <span style="color: #000000;">112</span> ;     <span style="color: #B900B9;">// cancel</span><br />         <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"CANCEL"</span> ;<br />         <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Cancel"</span> <span style="color: #0000ff;">LEFT</span> <span style="color: #000000;">2007</span>;<br />         <span style="color: #0000ff;">ACTION</span> oDLg:<span style="color: #000000;">ENd</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><br /><span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg ;<br />         <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span> oMemo:<span style="color: #000000;">SendMsg</span><span style="color: #000000;">&#40;</span> EM_LIMITTEXT,<span style="color: #000000;">500</span>,<span style="color: #000000;">0</span><span style="color: #000000;">&#41;</span>;<br />         <span style="color: #0000ff;">VALID</span> <span style="color: #000000;">&#40;</span>!GETKEYSTATE<span style="color: #000000;">&#40;</span> <span style="color: #000000;">27</span> <span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>  <span style="color: #B900B9;">// do not allow esc key here</span><br /><br /><span style="color: #00C800;">Return</span><span style="color: #000000;">&#40;</span><span style="color: #00C800;">nil</span><span style="color: #000000;">&#41;</span><br /> </div>[/code:3kjp4f4z] Here is the Memo.rc [code=fw:3kjp4f4z]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #B900B9;">// Generated by ResEdit 1.6.6</span><br /><span style="color: #B900B9;">// Copyright (C) 2006-2015</span><br /><span style="color: #B900B9;">// <!-- m --><a class="postlink" href="http://www.resedit.net">http://www.resedit.net</a><!-- m --></span><br /><br /><span style="color: #00D7D7;">#include</span> <windows.h><br /><span style="color: #00D7D7;">#include</span> <commctrl.h><br /><span style="color: #B900B9;">//#include "resource.h"</span><br /><br />#ifndef WC_STATIC<br /><span style="color: #00D7D7;">#define</span> WC_STATIC L<span style="color: #ff0000;">"Static"</span><br />#endif<br /><br />#ifndef MONTHCAL_CLASS<br /><span style="color: #00D7D7;">#define</span> MONTHCAL_CLASS <span style="color: #ff0000;">"SysMonthCal32"</span><br />#endif<br /><br />#ifndef DATETIMEPICK_CLASS<br /><span style="color: #00D7D7;">#define</span> DATETIMEPICK_CLASS <span style="color: #ff0000;">"SysDateTimePick32"</span><br />#endif<br /><br /><span style="color: #B900B9;">//</span><br /><span style="color: #B900B9;">// Dialog resources</span><br /><span style="color: #B900B9;">//</span><br />LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL<br />MEMO <span style="color: #0000ff;">DIALOG</span> <span style="color: #000000;">150</span>, <span style="color: #000000;">47</span>, <span style="color: #000000;">353</span>, <span style="color: #000000;">135</span><br /><span style="color: #0000ff;">STYLE</span> DS_MODALFRAME | DS_SETFONT | WS_CAPTION | WS_POPUP<br /><span style="color: #0000ff;">FONT</span> <span style="color: #000000;">6</span>, <span style="color: #ff0000;">"MS Sans Serif"</span><br /><span style="color: #000000;">&#123;</span><br />    EDITTEXT        <span style="color: #000000;">196</span>, <span style="color: #000000;">107</span>, <span style="color: #000000;">102</span>, <span style="color: #000000;">45</span>, <span style="color: #000000;">12</span>, WS_DISABLED | NOT WS_TABSTOP, WS_EX_LEFT<br />    LTEXT           <span style="color: #ff0000;">"Max 400 char"</span>, <span style="color: #000000;">195</span>, <span style="color: #000000;">4</span>, <span style="color: #000000;">103</span>, <span style="color: #000000;">95</span>, <span style="color: #000000;">9</span>, SS_LEFT | SS_NOPREFIX, WS_EX_LEFT<br />    EDITTEXT        <span style="color: #000000;">130</span>, <span style="color: #000000;">40</span>, <span style="color: #000000;">8</span>, <span style="color: #000000;">307</span>, <span style="color: #000000;">80</span>, WS_VSCROLL | ES_MULTILINE | ES_WANTRETURN, WS_EX_LEFT<br />    CONTROL         <span style="color: #ff0000;">"Ok"</span>, <span style="color: #000000;">111</span>, <span style="color: #ff0000;">"TBtnBmp"</span>, 0x50010020, <span style="color: #000000;">247</span>, <span style="color: #000000;">100</span>, <span style="color: #000000;">45</span>, <span style="color: #000000;">24</span>, 0x00000000<br />    LTEXT           <span style="color: #ff0000;">"Memo"</span>, <span style="color: #000000;">194</span>, <span style="color: #000000;">3</span>, <span style="color: #000000;">11</span>, <span style="color: #000000;">35</span>, <span style="color: #000000;">9</span>, SS_LEFT | SS_NOPREFIX, WS_EX_LEFT<br />    CONTROL         <span style="color: #ff0000;">"Cancel"</span>, <span style="color: #000000;">112</span>, <span style="color: #ff0000;">"TBtnBmp"</span>, 0x50010020, <span style="color: #000000;">300</span>, <span style="color: #000000;">100</span>, <span style="color: #000000;">45</span>, <span style="color: #000000;">24</span>, 0x00000000<br /><span style="color: #000000;">&#125;</span><br /> </div>[/code:3kjp4f4z]
Adding a real time character count to a memo field dialog bx
Rick, Change this. [code=fw:1806ybko]<div class="fw" id="{CB}" style="font-family: monospace;">       <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">GET</span> oMemo <span style="color: #0000ff;">VAR</span> cMEMO MEMO <span style="color: #0000ff;">ID</span> <span style="color: #000000;">130</span> <span style="color: #0000ff;">of</span> oDlg <span style="color: #0000ff;">UPDATE</span> ;<br />                    <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">CHANGE</span> <span style="color: #000000;">&#40;</span>oSay:<span style="color: #000000;">VarPut</span><span style="color: #000000;">&#40;</span>ALLTRIM<span style="color: #000000;">&#40;</span>str<span style="color: #000000;">&#40;</span>LEN<span style="color: #000000;">&#40;</span>oMemo:<span style="color: #000000;">GetText</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>,;<br />                oSay:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span></div>[/code:1806ybko]
Adding a real time character count to a memo field dialog bx
Hakan Thank you VERY much for your input and nicely done.. works perfectly .. Enrico .. again that you very much for your help!! Rick Lipkin
Adding a register key to the Windows register - SOLVED
Hello, I need this register key : [HKEY_CURRENT_USER\Software\Microsoft\Office\16.0\Word\Security] "DisableWarningOnIncludeFieldsUpdate"=dword:00000001 How can I check in my application if this key already exists? And in case it doesn't exist, how can I add it in my application? Thank you very much in advance for any help.
Adding a register key to the Windows register - SOLVED
Dear Michel, Please try this and let me know what you get: [code=fw:20ggt634]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00D7D7;">#define</span> &nbsp;HKEY_CURRENT_USER &nbsp; &nbsp; &nbsp; <span style="color: #000000;">2147483649</span>   <br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> nHandle, nValue <br /><br />   <span style="color: #00C800;">if</span> RegOpenKey<span style="color: #000000;">&#40;</span> HKEY_CURRENT_USER,;<br />         <span style="color: #ff0000;">"Software<span style="color: #000000;">\M</span>icrosoft<span style="color: #000000;">\O</span>ffice<span style="color: #000000;">\1</span>6.0<span style="color: #000000;">\W</span>ord<span style="color: #000000;">\S</span>ecurity"</span>, @nHandle <span style="color: #000000;">&#41;</span> == <span style="color: #000000;">0</span><br />      RegQueryValue<span style="color: #000000;">&#40;</span> nHandle, <span style="color: #ff0000;">"DisableWarningOnIncludeFieldsUpdate"</span>, @nValue <span style="color: #000000;">&#41;</span><br />      <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">&#40;</span> nValue, ValType<span style="color: #000000;">&#40;</span> nValue <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />      RegCloseKey<span style="color: #000000;">&#40;</span> nHandle <span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">endif</span></div>[/code:20ggt634]
Adding a register key to the Windows register - SOLVED
Antonio, Thank you for your message. Unfortunately, the register key is not added.
Adding a register key to the Windows register - SOLVED
Dear Michel, what is shown from the MsgInfo() ?
Adding a register key to the Windows register - SOLVED
Only a backslash
Adding a register key to the Windows register - SOLVED
Dear Michel, Please use Microsoft regedit.exe and try to locate it manually
Adding a register key to the Windows register - SOLVED
hi, [quote="driessen":2f4ugwml]Unfortunately, the register key is not added.[/quote:2f4ugwml] have you start it "as Admin" <!-- s:?: --><img src="{SMILIES_PATH}/icon_question.gif" alt=":?:" title="Question" /><!-- s:?: -->
Adding a register key to the Windows register - SOLVED
look, [url:2agn1eb5]https&#58;//forums&#46;fivetechsupport&#46;com/viewtopic&#46;php?f=3&t=42673&p=256920&hilit=TReg32&sid=f15a2b41e9a2f5c0991f021a042fe9ab&sid=f2ce5d0132445ffed2f9e303a9e535a2#p256920[/url:2agn1eb5] Regards, saludos.
Adding a register key to the Windows register - SOLVED
[code=fw:fyj2qwgz]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #B900B9;">// Managing Register services from FiveWin</span><br /><br /><span style="color: #00D7D7;">#define</span>  HKEY_CLASSES_ROOT       <span style="color: #000000;">2147483648</span><br /><span style="color: #00D7D7;">#define</span>  HKEY_CURRENT_USER       <span style="color: #000000;">2147483649</span><br /><span style="color: #00D7D7;">#define</span>  HKEY_LOCAL_MACHINE      <span style="color: #000000;">2147483650</span><br /><span style="color: #00D7D7;">#define</span>  HKEY_USERS              <span style="color: #000000;">2147483651</span><br /><span style="color: #00D7D7;">#define</span>  HKEY_PERFORMANCE_DATA   <span style="color: #000000;">2147483652</span><br /><span style="color: #00D7D7;">#define</span>  HKEY_CURRENT_CONFIG     <span style="color: #000000;">2147483653</span><br /><span style="color: #00D7D7;">#define</span>  HKEY_DYN_DATA           <span style="color: #000000;">2147483654</span><br /><br /><span style="color: #B900B9;">//---------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">function</span> Main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /> <br />      <span style="color: #00C800;">LOCAL</span> nHKey    := HKEY_CURRENT_USER<br />      <span style="color: #00C800;">LOCAL</span> cRegPath := <span style="color: #ff0000;">"SOFTWARE<span style="color: #000000;">\M</span>icrosoft<span style="color: #000000;">\O</span>ffice<span style="color: #000000;">\1</span>6.0<span style="color: #000000;">\W</span>ord<span style="color: #000000;">\S</span>ecurity"</span><br />      <br />      <span style="color: #B900B9;">// Set without any Check</span><br />      <span style="color: #B900B9;">// Setregistry( nHKey, cRegPath,  "DisableWarningOnIncludeFieldsUpdate", 1)</span><br />    <br />         <span style="color: #B900B9;">// Check Registryvalue</span><br />      <span style="color: #00C800;">IF</span> .NOT. QueryRegistry<span style="color: #000000;">&#40;</span> nHKey, cRegPath, ;<br />                             <span style="color: #ff0000;">"DisableWarningOnIncludeFieldsUpdate"</span>, <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span><br /><br />         <span style="color: #B900B9;">// ... and create it</span><br />         QueryRegistry<span style="color: #000000;">&#40;</span> nHKey, cRegPath, ;<br />                       <span style="color: #ff0000;">"DisableWarningOnIncludeFieldsUpdate"</span>, <span style="color: #000000;">1</span>, .T. <span style="color: #000000;">&#41;</span><br />      <span style="color: #00C800;">ENDIF</span><br />        <br />      <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">&#40;</span>GetRegistry<span style="color: #000000;">&#40;</span> nHKey, cRegPath, <span style="color: #ff0000;">"DisableWarningOnIncludeFieldsUpdate"</span> <span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>  <span style="color: #B900B9;">// result: 1</span><br />    <br />   <span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//---------------------------------------------------------------------------//</span></div>[/code:fyj2qwgz]
Adding a register key to the Windows register - SOLVED
Alerchster, Thank you so much for your help. It works fantastic now. One more little question. Can you tell me how to delete a registry key? Thank you very much.
Adding a register key to the Windows register - SOLVED
Antonio, To find the registry key manually is no problem. Jimmy, I am administrator.
Adding a register key to the Windows register - SOLVED
Dear Michel, Do you have the entry "DisableWarningOnIncludeFieldsUpdate" already created ?
Adding a register key to the Windows register - SOLVED
Antonio, I have created the key manually. That is no problem. But I want my application to add the key automatically so that it is installed on all PC’s on which my applications are used. This key is necessary to prevent a mastbos is shown in Word everytime a document is used that has been mailed to my customer. My customers use hundredthousands documents, so by this key a click is avoided everytime a document is opened.
Adding a register key to the Windows register - SOLVED
Hello Michel, Maybe you have to grant the user admin rights when setting this key. I want to remind you that you need to set this key for every user. Best regards, Otto
Adding a register key to the Windows register - SOLVED
Not my cup of thee, but in this code there is also a register search and add. Maybe it is helpfull From Karinha [url:z0h29bxc]https&#58;//forums&#46;fivetechsupport&#46;com/viewtopic&#46;php?f=3&t=41666#p249622[/url:z0h29bxc] [code=fw:z0h29bxc]<div class="fw" id="{CB}" style="font-family: monospace;"><br />   <span style="color: #00C800;">if</span> <span style="color: #000000;">&#40;</span>RegOpenKey<span style="color: #000000;">&#40;</span>HKEY_CURRENT_USER, KEY_DISABLETASKMGR, &hKey<span style="color: #000000;">&#41;</span> != ERROR_SUCCESS<span style="color: #000000;">&#41;</span><br />        <span style="color: #00C800;">if</span> <span style="color: #000000;">&#40;</span>RegCreateKey<span style="color: #000000;">&#40;</span>HKEY_CURRENT_USER, KEY_DISABLETASKMGR, &hKey<span style="color: #000000;">&#41;</span> != ERROR_SUCCESS<span style="color: #000000;">&#41;</span><br />            <span style="color: #00C800;">return</span> <span style="color: #000000;">0</span>;<br /><br />    <span style="color: #00C800;">if</span> <span style="color: #000000;">&#40;</span>bEnableDisable<span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">// Enable</span><br />    <span style="color: #000000;">&#123;</span><br />        r = RegDeleteValue<span style="color: #000000;">&#40;</span>hKey, VAL_DISABLETASKMGR<span style="color: #000000;">&#41;</span>;<br />    <span style="color: #000000;">&#125;</span><br />    <span style="color: #00C800;">else</span>                <span style="color: #B900B9;">// Disable</span><br />    <span style="color: #000000;">&#123;</span><br />        val = <span style="color: #000000;">1</span>;<br />        r = RegSetValueEx<span style="color: #000000;">&#40;</span>hKey, VAL_DISABLETASKMGR, <span style="color: #000000;">0</span>, REG_DWORD, <span style="color: #000000;">&#40;</span>BYTE *<span style="color: #000000;">&#41;</span>&val, sizeof<span style="color: #000000;">&#40;</span>val<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>;<br />    <span style="color: #000000;">&#125;</span><br /><br />    RegCloseKey<span style="color: #000000;">&#40;</span>hKey<span style="color: #000000;">&#41;</span>;<br /><br />    <span style="color: #00C800;">return</span> <span style="color: #000000;">&#40;</span>r == ERROR_SUCCESS ? <span style="color: #000000;">1</span> : <span style="color: #000000;">0</span><span style="color: #000000;">&#41;</span> ;<br /><span style="color: #000000;">&#125;</span><br /><br /> </div>[/code:z0h29bxc]
Adding a register key to the Windows register - SOLVED
[code=fw:2rkbu6c9]<div class="fw" id="{CB}" style="font-family: monospace;">win_regdelete<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"HKEY_CURRENT_USER<span style="color: #000000;">\S</span>OFTWARE<span style="color: #000000;">\M</span>icrosoft<span style="color: #000000;">\O</span>ffice<span style="color: #000000;">\1</span>6.0<span style="color: #000000;">\W</span>ord<span style="color: #000000;">\S</span>ecurity<span style="color: #000000;">\D</span>isableWarningOnIncludeFieldsUpdate"</span><span style="color: #000000;">&#41;</span></div>[/code:2rkbu6c9]
Adding a register key to the Windows register - SOLVED
Dear Michel, from Harbour Changelog file: [code=fw:1ulpzy2b]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #000000;">2012</span><span style="color: #000000;">-05</span><span style="color: #000000;">-18</span> <span style="color: #000000;">18</span>:<span style="color: #000000;">15</span> UTC<span style="color: #000000;">+0300</span> Pavel Tsarenko <span style="color: #000000;">&#40;</span>tpe2 <span style="color: #00C800;">at</span> <span style="color: #0000ff;">mail</span>.ru<span style="color: #000000;">&#41;</span><br />&nbsp; * contrib/hbwin/win_reg.prg<br />&nbsp; * contrib/hbwin/tests/test_reg.prg<br />&nbsp; &nbsp; * added nRegSam <span style="color: #000000;">&#40;</span>access mask<span style="color: #000000;">&#41;</span> parameter into functions: <span style="color: #000000;">win_regRead</span>,<br />&nbsp; &nbsp; &nbsp; win_regWrite, win_regGet, win_regDelete, win_regQuery, win_regSet.<br />&nbsp; &nbsp; &nbsp; This parameter can be used in win32 applications, running under<br />&nbsp; &nbsp; &nbsp; win64 systems <span style="color: #00C800;">for</span> access <span style="color: #0000ff;">to</span> <span style="color: #000000;">32</span>-bit or <span style="color: #000000;">64</span>-bit registry.</div>[/code:1ulpzy2b] I hope this help you. Best regards,
Adding a register key to the Windows register - SOLVED
Hi Guys, Thank you all so much for your help. All my questions have been answered. Everything is running just fine now.
Adding an Element to a Combobox array
To All I have an array that is created from a table and I use that array as the pick list from a combobox [code=fw:is7zcqtb]<div class="fw" id="{CB}" style="font-family: monospace;"><br />aBin := <span style="color: #000000;">&#123;</span><span style="color: #000000;">&#125;</span><br /><br />oRsBin:<span style="color: #000000;">MoveFirst</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">Do</span> <span style="color: #00C800;">While</span> .not. oRsBin:<span style="color: #000000;">eof</span><br /><br />   cName := oRsBin:<span style="color: #000000;">Fields</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"Bin"</span><span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Value</span><br />   AAdd<span style="color: #000000;">&#40;</span> aBin, cName <span style="color: #000000;">&#41;</span><br />   oRsBin:<span style="color: #000000;">MoveNext</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />End <span style="color: #00C800;">Do</span><br /><br />oRsBin:<span style="color: #000000;">CLose</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />oRsBin := <span style="color: #00C800;">NIL</span><br /><br />...<br />...<br /><br /> <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">COMBOBOX</span> oBin  <span style="color: #0000ff;">var</span> cBin         <span style="color: #0000ff;">ID</span> <span style="color: #000000;">171</span> <span style="color: #0000ff;">of</span> oInvt  ;<br />            <span style="color: #0000ff;">ITEMS</span> aBin <span style="color: #0000ff;">UPDATE</span><br /><br /> </div>[/code:is7zcqtb] I have a side button function that adds a new record to the table then adds that new element to the passed array ( by reference ) . [code=fw:is7zcqtb]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">BTNBMP</span> oBTN10 <span style="color: #0000ff;">ID</span> <span style="color: #000000;">153</span> <span style="color: #0000ff;">of</span> oInvt  ;     <span style="color: #B900B9;">// add bin</span><br />            <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Add"</span> <span style="color: #0000ff;">CENTER</span> <span style="color: #000000;">2007</span>;<br />            <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> _BinView<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"A"</span>, <span style="color: #ff0000;">""</span>, <span style="color: #ff0000;">"INV"</span>, @aBin, @cBin, oBin <span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br /> </div>[/code:is7zcqtb] [code=fw:is7zcqtb]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><br />FUNC _BinView<span style="color: #000000;">&#40;</span> cMODE, oRsBin, cFrom, aBin, cBin, oBin <span style="color: #000000;">&#41;</span><br /><br />...<br />...<br /><span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oUSERS <span style="color: #B900B9;">// modal dialog</span><br /><br /><br /><span style="color: #00C800;">If</span> cFrom = <span style="color: #ff0000;">"INV"</span> .and. cMode = <span style="color: #ff0000;">"A"</span><br /> *  <span style="color: #0000ff;">xbrowse</span><span style="color: #000000;">&#40;</span> abin <span style="color: #000000;">&#41;</span><br /><br />   cName := oRsBin:<span style="color: #000000;">Fields</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"Bin"</span><span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Value</span><br />   <span style="color: #0000ff;">msginfo</span><span style="color: #000000;">&#40;</span> cName <span style="color: #000000;">&#41;</span><br /><br />   AAdd<span style="color: #000000;">&#40;</span> aBin, cName <span style="color: #000000;">&#41;</span><br />   oRsBin:<span style="color: #000000;">CLose</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />   cBin := cName<br />   oBin:<span style="color: #0000ff;">ReFresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /> *  <span style="color: #0000ff;">xbrowse</span><span style="color: #000000;">&#40;</span> abin <span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">ENdif</span><br /><br />lOK1 := lOK<br /><br /><span style="color: #00C800;">RETURN</span><span style="color: #000000;">&#40;</span> lOK1 <span style="color: #000000;">&#41;</span><br /><br /> </div>[/code:is7zcqtb] As I have tested .. the passed array is being appended as it was passed by reference .. but the list of values ( aBin array ) does not change when I go back and pull down the list in the Combobox. As you can see .. I am trying to Refresh all the objects but when I return to the combobox .. aBin is not updated with my new record. Obviously this has something to do with updating the aBin variable on the Combobox .. any help would be appreciated. Rick Lipkin
Adding an Element to a Combobox array
Rick, try using oCbx:SetItems( aBin ) method. EMG
Adding an Element to a Combobox array
Enrico Thank you! Worked great Rick Lipkin
Adding an option to right click menu on TGet.
Hi, I want to add an option to right click menu in TGet. I have done in system menu using SYSMENU. Is there any clause for this? Thanks
Adding and Deleting tabs on Dlg at runtime
Hi everyone; I wish to add tabs to a FW folder control at runtime. Likewise, I'd like to add an x btnbmp at the right of the tab to allow closing the tab page. The tab control is on a dialog control. In short, it would look like browser tabs that you can keep creating or deleting at any time. Is this possible? Any samples? Thank you for any help, Reinaldo.
Adding and Deleting tabs on Dlg at runtime
Hello yes, review sample testfldd.prg it's a mod form testfldd.prg [code=fw:70ppj78h]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #B900B9;">// Dinamically adding pages and controls</span><br /><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"FiveWin.ch"</span><br /><br /><span style="color: #00C800;">function</span> Main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oDlg, oFld<br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"test"</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">FOLDER</span> oFld <span style="color: #0000ff;">ID</span> <span style="color: #000000;">110</span> <span style="color: #0000ff;">OF</span> oDlg ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">DIALOGS</span> <span style="color: #ff0000;">"dlg1"</span>, <span style="color: #ff0000;">"dlg2"</span> <span style="color: #0000ff;">PROMPTS</span> <span style="color: #ff0000;">"One"</span>, <span style="color: #ff0000;">"Two"</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">ID</span> <span style="color: #000000;">120</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">ACTION</span> oDlg:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</span> ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span> AddDialog<span style="color: #000000;">&#40;</span> oFld <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #00C800;">function</span> AddDialog<span style="color: #000000;">&#40;</span> oFld <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> nOpt<br /><br />&nbsp; &nbsp;oFld:<span style="color: #000000;">AddItem</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"third"</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<br />&nbsp; &nbsp;@ <span style="color: #000000;">2</span>, <span style="color: #000000;">2</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">"Add from res"</span> <span style="color: #0000ff;">OF</span> oFld:<span style="color: #000000;">aDialogs</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">3</span> <span style="color: #000000;">&#93;</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">80</span>, <span style="color: #000000;">20</span> ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> oFld:<span style="color: #000000;">AddItem</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Fourth"</span>, <span style="color: #ff0000;">"dlg2"</span>, <span style="color: #000000;">&#123;</span> | oDlg | RedefineControls<span style="color: #000000;">&#40;</span> oDlg <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ATail<span style="color: #000000;">&#40;</span> oFld:<span style="color: #000000;">aDialogs</span> <span style="color: #000000;">&#41;</span>:<span style="color: #000000;">SetFont</span><span style="color: #000000;">&#40;</span> oFld:<span style="color: #000000;">oFont</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;@ <span style="color: #000000;">4</span>, <span style="color: #000000;">2</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">"Del Last Tab"</span> <span style="color: #0000ff;">OF</span> oFld:<span style="color: #000000;">aDialogs</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">3</span> <span style="color: #000000;">&#93;</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">80</span>, <span style="color: #000000;">20</span> ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> nOpt := oFld:<span style="color: #000000;">nOption</span>, oFld:<span style="color: #000000;">nOption</span> := Len<span style="color: #000000;">&#40;</span> oFld:<span style="color: #000000;">aPrompts</span> <span style="color: #000000;">&#41;</span>, oFld:<span style="color: #000000;">DelItem</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, oFld:<span style="color: #000000;">SetOption</span><span style="color: #000000;">&#40;</span> nOpt <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #00C800;">function</span> RedefineControls<span style="color: #000000;">&#40;</span> oDlg <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> nValue := <span style="color: #000000;">1</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">RADIO</span> nValue <span style="color: #0000ff;">ID</span> <span style="color: #000000;">110</span>, <span style="color: #000000;">120</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">CHANGE</span> MsgBeep<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span> &nbsp; <br />&nbsp;</div>[/code:70ppj78h]
Adding bitmaps to themed rPreview toolbar
Hi Antonio I am trying to add different bitmaps to the themed rPreview toolbar These bitmaps are contained in my normal RES file (not in Prev32.dll) I cant get this to work eg below even thing Bmp_Pdf exists in my resources, it wont display * Code snippet* ::oImageList:AddMasked( TBitmap():Define( ""BMP_Pdf"",, ::oWnd ), nRGB( 192, 192, 192 ) ) Do image lists require special kinds of bmps? Would appreciate any assistance Thanks Peter
Adding bitmaps to themed rPreview toolbar
Hi Antonio I am trying to add different bitmaps to the themed rPreview toolbar These bitmaps are contained in my normal RES file (not in Prev32.dll) I cant get this to work eg below even though Bmp_Pdf exists in my resources, it wont display * Code snippet* ::oImageList:AddMasked( TBitmap():Define( ""BMP_Pdf"",, ::oWnd ), nRGB( 192, 192, 192 ) ) Do image lists require special kinds of bmps? Would appreciate any assistance Thanks Peter
Adding bitmaps to themed rPreview toolbar
How can you converte the preview in pdf file ?
Adding bitmaps to themed rPreview toolbar
Peter, Where are you adding that code? If it is inside the rpreview function then you have to switch to your resources to load your bitmap, then switch back (see getResources() and setResources() near the top of the rpreview function in rpreview.prg). I also note that oImageList and oWnd are locals in this routine but you have them as instance vars. James
Adding bitmaps to themed rPreview toolbar
Silvio; Read here: [/url] <!-- m --><a class="postlink" href="http://fivetechsoft.com/forums/viewtopic.php?t=4757">http://fivetechsoft.com/forums/viewtopic.php?t=4757</a><!-- m --> [url] It absolutely works great! Reinaldo.
Adding bitmaps to themed rPreview toolbar
1) :: is there because we have converted rPreview to a class 2) The pdf utility we are using is <!-- w --><a class="postlink" href="http://www.utilitywarrior.com">www.utilitywarrior.com</a><!-- w --> product 3) I did try "SET RESOURCES TO" before the "::oImageList:AddMasked( TBitmap():Define( "BMP_Pdf", , ::oWnd ), nRGB( 255, 255, 255 ) )" line, but this does not work 4) I tried putting the bitmap in prev32.dll (using resource builder) - that also did not work I am thinking that maybe theming requires a special type of bitmap ? I have run out of ideas Thanks Peter
Adding bitmaps to themed rPreview toolbar
Peter, Has the bitmap the same dimensions of the other bitmaps ?
Adding bitmaps to themed rPreview toolbar
Peter, >1) :: is there because we have converted rPreview to a class Then, are you sure this code is getting linked in and used? One way to find out is to put a msgInfo() in it. >I am thinking that maybe theming requires a special type of bitmap? Not so, all my apps are themed and all my bitmaps work fine. James
Adding bitmaps to themed rPreview toolbar
to converte rpreview to a class is easy... and then ?
Adding bitmaps to themed rPreview toolbar
Hi All I have resolved this. The problem was caused because the no of bitmaps in the imagelist is > than the no of btns, and I was assuming the my new pdf btn corresponded to the correct bmp in the imagelist. I had to add a call to ::oBar:ChangeBitmap() to set my Pdf btn to the correct bmp. All ok now. Thanks for the assistance Peter
Adding button in excel with FW
Hi, Does anyone have an example how to add a button on an excel-sheet? Thank you,
Adding button in excel with FW
Hi Marc. Sorry, I don't know how to do this with FWH and ole commands. But here an example for adding a button tonabworksheet of excel. [code=fw:2hadb4ui]<div class="fw" id="{CB}" style="font-family: monospace;"> Sub AddButtonAndCode<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <br />     <span style="color: #ff0000;">' Declare variables<br />    Dim i As Long, Hght As Long <br />    Dim Name As String, NName As String <br />     '</span> Set the <span style="color: #0000ff;">button</span> properties<br />    i = <span style="color: #000000;">0</span> <br />    Hght = <span style="color: #000000;">305.25</span> <br />     <span style="color: #ff0000;">' Set the name for the button<br />    NName = "cmdAction" & i <br />     '</span> Test <span style="color: #00C800;">if</span> there is a <span style="color: #0000ff;">button</span> already and <span style="color: #00C800;">if</span> so, increment its <span style="color: #0000ff;">name</span><br />    <span style="color: #00C800;">For</span> Each OLEObject In ActiveSheet.OLEObjects <br />        <span style="color: #00C800;">If</span> <span style="color: #0000ff;">Left</span><span style="color: #000000;">&#40;</span>OLEObject.<span style="color: #0000ff;">Name</span>, <span style="color: #000000;">9</span><span style="color: #000000;">&#41;</span> = <span style="color: #ff0000;">"cmdAction"</span> Then <br />            <span style="color: #0000ff;">Name</span> = <span style="color: #0000ff;">Right</span><span style="color: #000000;">&#40;</span>OLEObject.<span style="color: #0000ff;">Name</span>, Len<span style="color: #000000;">&#40;</span>OLEObject.<span style="color: #0000ff;">Name</span><span style="color: #000000;">&#41;</span> - <span style="color: #000000;">9</span><span style="color: #000000;">&#41;</span> <br />            <span style="color: #00C800;">If</span> <span style="color: #0000ff;">Name</span> >= i Then <br />                i = <span style="color: #0000ff;">Name</span> + <span style="color: #000000;">1</span> <br />            End <span style="color: #00C800;">If</span> <br />            NName = <span style="color: #ff0000;">"cmdAction"</span> & i <br />            Hght = Hght + <span style="color: #000000;">27</span> <br />        End <span style="color: #00C800;">If</span> <br />    <span style="color: #00C800;">Next</span> <br />     <span style="color: #ff0000;">' Add button<br />    Dim myCmdObj As OLEObject, N% <br />    Set myCmdObj = ActiveSheet.OLEObjects.Add(ClassType:="Forms.CommandButton.1", _ <br />    Link:=False, DisplayAsIcon:=False, Left:=52.5, Top:=Hght, _ <br />    Width:=202.5, Height:=26.25) <br />     '</span> <span style="color: #0000ff;">Define</span> buttons <span style="color: #0000ff;">name</span><br />    myCmdObj.<span style="color: #0000ff;">Name</span> = NName <br />     <span style="color: #ff0000;">' Define buttons caption<br />    myCmdObj.Object.Caption = "Click for action" <br />     '</span> Inserts code <span style="color: #00C800;">for</span> the <span style="color: #0000ff;">button</span><br />    With ThisWorkbook.VBProject.VBComponents<span style="color: #000000;">&#40;</span>ActiveSheet.CodeName<span style="color: #000000;">&#41;</span>.CodeModule <br />        N = .CountOfLines <br />        .InsertLines N + <span style="color: #000000;">1</span>, <span style="color: #ff0000;">"Private Sub "</span> & NName & <span style="color: #ff0000;">"_Click()"</span> <br />        .InsertLines N + <span style="color: #000000;">2</span>, vbNewLine <br />        .InsertLines N + <span style="color: #000000;">3</span>, vbTab & <span style="color: #ff0000;">"MsgBox("</span> & <span style="color: #ff0000;">""</span><span style="color: #ff0000;">""</span> & <span style="color: #ff0000;">"Button Clicked!"</span> & <span style="color: #ff0000;">""</span><span style="color: #ff0000;">""</span> & <span style="color: #ff0000;">" & vbCrLf &"</span> & _ <br />        <span style="color: #ff0000;">""</span><span style="color: #ff0000;">""</span> & <span style="color: #ff0000;">"Put your code here!"</span> & <span style="color: #ff0000;">""</span><span style="color: #ff0000;">""</span> & <span style="color: #ff0000;">" & vbCrLf & "</span> & <span style="color: #ff0000;">""</span><span style="color: #ff0000;">""</span> & <span style="color: #ff0000;">"This is "</span> & <span style="color: #ff0000;">""</span><span style="color: #ff0000;">""</span> & _ <br />        <span style="color: #ff0000;">"& "</span> & <span style="color: #ff0000;">""</span><span style="color: #ff0000;">""</span> & NName & <span style="color: #ff0000;">""</span><span style="color: #ff0000;">""</span> & <span style="color: #ff0000;">")"</span> <br />        .InsertLines N + <span style="color: #000000;">4</span>, vbNewLine <br />        .InsertLines N + <span style="color: #000000;">5</span>, <span style="color: #ff0000;">"End Sub"</span> <br />    End With <br />End Sub</div>[/code:2hadb4ui] Perhaps this could give you an idea? Regards, Detlef