<![CDATA[HMGforum.com]]> http://www.hmgforum.com 2018-10-17T04:05:06-04:00 Smartfeed extension for phpBB <![CDATA[HMG Unicode version :: Change the active keyboard :: Author miroslav.maričić]]> 2018-10-16T05:27:06-04:00 2018-10-16T05:27:06-04:00 http://www.hmgforum.com/viewtopic.php?f=43&t=5826&p=56478#p56478 СРБ:
Желео бих да урадим следеће:
- Чим се програм стартује да упамти актуелну тастатуру,
- Да постави тастатуру по жељи (на пример, Српска ћирилица),
- Пре изласка из програма да се врати упамћена тастатура.
Надам се да је пост разумљив, пошто сам превео помоћу Гугла :D

ENG:
I would like to do the following:
- As soon as the program starts to remember the current keyboard,
- Set the keyboard as desired (for example, Serbian Cyrillic),
- Before exiting the program, return the memorized keyboard.
I hope the post is understandable, since I translated it using Google :D]]>
СРБ:
Желео бих да урадим следеће:
- Чим се програм стартује да упамти актуелну тастатуру,
- Да постави тастатуру по жељи (на пример, Српска ћирилица),
- Пре изласка из програма да се врати упамћена тастатура.
Надам се да је пост разумљив, пошто сам превео помоћу Гугла :D

ENG:
I would like to do the following:
- As soon as the program starts to remember the current keyboard,
- Set the keyboard as desired (for example, Serbian Cyrillic),
- Before exiting the program, return the memorized keyboard.
I hope the post is understandable, since I translated it using Google :D]]>
<![CDATA[HMG General Help :: Re: Help needed with CURL/JSON :: Reply by mlnr]]> 2018-10-16T08:41:46-04:00 2018-10-16T08:41:46-04:00 http://www.hmgforum.com/viewtopic.php?f=5&t=5823&p=56481#p56481

Try to add the next lines in the Send_Wetransfer()

CODE: Select all

  headers:={}
  AADD(headers,"Content-Type: application/json")
  AADD(headers,"x-api-key: my_key")

  curl_easy_setopt(curl, HB_CURLOPT_HTTPHEADER, headers)
]]>


Try to add the next lines in the Send_Wetransfer()

CODE: Select all

  headers:={}
  AADD(headers,"Content-Type: application/json")
  AADD(headers,"x-api-key: my_key")

  curl_easy_setopt(curl, HB_CURLOPT_HTTPHEADER, headers)
]]>
<![CDATA[HMG General Help :: Re: Help needed with CURL/JSON :: Reply by serge_girard]]> 2018-10-16T09:03:02-04:00 2018-10-16T09:03:02-04:00 http://www.hmgforum.com/viewtopic.php?f=5&t=5823&p=56482#p56482
Thanks, I allready tried that with this as result:

CODE: Select all

Failure when receiving data from the peer
Should I comment these lines:?

CODE: Select all

//curl_easy_setopt( curlHandle, HB_CURLOPT_POSTFIELDSIZE, LEN( cPOSTdata ) )
//curl_easy_setopt( curlHandle, HB_CURLOPT_POSTFIELDS, cPOSTdata )
Serge]]>

Thanks, I allready tried that with this as result:

CODE: Select all

Failure when receiving data from the peer
Should I comment these lines:?

CODE: Select all

//curl_easy_setopt( curlHandle, HB_CURLOPT_POSTFIELDSIZE, LEN( cPOSTdata ) )
//curl_easy_setopt( curlHandle, HB_CURLOPT_POSTFIELDS, cPOSTdata )
Serge]]>
<![CDATA[HMG General Help :: Re: Help needed with CURL/JSON :: Reply by mlnr]]> 2018-10-16T09:03:51-04:00 2018-10-16T09:03:51-04:00 http://www.hmgforum.com/viewtopic.php?f=5&t=5823&p=56483#p56483

CODE: Select all

FUNCTION Curl_Func(params, postRequest, resultFile)
    LOCAL curl
    LOCAL requestParams := ""
    LOCAL param
    LOCAL result
    LOCAL _cURL:="https://dev.wetransfer.com/v2/authorize"
    LOCAL headers:={}
    
    AADD(headers,"Content-Type: application/json")
    AADD(headers,"x-api-key: your_api_key")

    // Default
    IF(params == NIL); params := {}; ENDIF
    IF(postRequest == NIL); postRequest := .F.; ENDIF

    // Init cURL
    curl_global_init()
    curl := curl_easy_init()

    // Do NOT include header in output
    curl_easy_setopt(curl, HB_CURLOPT_HEADER, .F.)

    // Parameters
    FOR EACH param IN params
        requestParams += param[1] + "=" + curl_easy_escape(curl, AllTrim(HB_ValToStr(param[2]))) + "&"
    NEXT

    // Removes trailing &
    IF(LEN(requestParams) > 0)
        requestParams := LEFT(requestParams, LEN(requestParams) - 1)
    ENDIF

    IF(postRequest)
        // POST request
        curl_easy_setopt(curl, HB_CURLOPT_NOSIGNAL, 1)
        curl_easy_setopt(curl, HB_CURLOPT_TIMEOUT_MS, 2000) // no default
        curl_easy_setopt(curl, HB_CURLOPT_POST, .T.)
        curl_easy_setopt(curl, HB_CURLOPT_POSTFIELDS, requestParams)
        curl_easy_setopt(curl, HB_CURLOPT_HTTPHEADER, headers)
        curl_easy_setopt(curl, HB_CURLOPT_URL, _cURL)
    ELSE
        curl_easy_setopt(curl, HB_CURLOPT_URL, _cURL + "?" + requestParams)
    ENDIF

    // Save result to file?
    IF(resultFile != NIL)
        curl_easy_setopt(curl, HB_CURLOPT_DL_FILE_SETUP, resultFile)
        result := .T.
    ELSE
        curl_easy_setopt(curl, HB_CURLOPT_DL_BUFF_SETUP)
    ENDIF

    // Execute
    curl_easy_perform(curl)

    // Load result from buffer into variable
    IF(result == NIL)
        result := curl_easy_dl_buff_get(curl)
    ENDIF

    curl_easy_cleanup(curl)
    curl_global_cleanup()

RETURN result
]]>

CODE: Select all

FUNCTION Curl_Func(params, postRequest, resultFile)
    LOCAL curl
    LOCAL requestParams := ""
    LOCAL param
    LOCAL result
    LOCAL _cURL:="https://dev.wetransfer.com/v2/authorize"
    LOCAL headers:={}
    
    AADD(headers,"Content-Type: application/json")
    AADD(headers,"x-api-key: your_api_key")

    // Default
    IF(params == NIL); params := {}; ENDIF
    IF(postRequest == NIL); postRequest := .F.; ENDIF

    // Init cURL
    curl_global_init()
    curl := curl_easy_init()

    // Do NOT include header in output
    curl_easy_setopt(curl, HB_CURLOPT_HEADER, .F.)

    // Parameters
    FOR EACH param IN params
        requestParams += param[1] + "=" + curl_easy_escape(curl, AllTrim(HB_ValToStr(param[2]))) + "&"
    NEXT

    // Removes trailing &
    IF(LEN(requestParams) > 0)
        requestParams := LEFT(requestParams, LEN(requestParams) - 1)
    ENDIF

    IF(postRequest)
        // POST request
        curl_easy_setopt(curl, HB_CURLOPT_NOSIGNAL, 1)
        curl_easy_setopt(curl, HB_CURLOPT_TIMEOUT_MS, 2000) // no default
        curl_easy_setopt(curl, HB_CURLOPT_POST, .T.)
        curl_easy_setopt(curl, HB_CURLOPT_POSTFIELDS, requestParams)
        curl_easy_setopt(curl, HB_CURLOPT_HTTPHEADER, headers)
        curl_easy_setopt(curl, HB_CURLOPT_URL, _cURL)
    ELSE
        curl_easy_setopt(curl, HB_CURLOPT_URL, _cURL + "?" + requestParams)
    ENDIF

    // Save result to file?
    IF(resultFile != NIL)
        curl_easy_setopt(curl, HB_CURLOPT_DL_FILE_SETUP, resultFile)
        result := .T.
    ELSE
        curl_easy_setopt(curl, HB_CURLOPT_DL_BUFF_SETUP)
    ENDIF

    // Execute
    curl_easy_perform(curl)

    // Load result from buffer into variable
    IF(result == NIL)
        result := curl_easy_dl_buff_get(curl)
    ENDIF

    curl_easy_cleanup(curl)
    curl_global_cleanup()

RETURN result
]]>
<![CDATA[HMG General Help :: Re: Help needed with CURL/JSON :: Reply by mlnr]]> 2018-10-16T09:21:07-04:00 2018-10-16T09:21:07-04:00 http://www.hmgforum.com/viewtopic.php?f=5&t=5823&p=56484#p56484

CODE: Select all

  fpParams:={}
  cText:=Curl_Func(fpParams, .T.,,)
]]>

CODE: Select all

  fpParams:={}
  cText:=Curl_Func(fpParams, .T.,,)
]]>
<![CDATA[HMG General Help :: Re: Help needed with CURL/JSON :: Reply by serge_girard]]> 2018-10-16T13:28:16-04:00 2018-10-16T13:28:16-04:00 http://www.hmgforum.com/viewtopic.php?f=5&t=5823&p=56488#p56488
Result is empty, so something is wrong!

Serge]]>

Result is empty, so something is wrong!

Serge]]>
<![CDATA[HMG General Help :: Re: Help needed with CURL/JSON :: Reply by mlnr]]> 2018-10-17T03:45:54-04:00 2018-10-17T03:45:54-04:00 http://www.hmgforum.com/viewtopic.php?f=5&t=5823&p=56491#p56491
I'm not test, but i will check the example.

Try this.

CODE: Select all

    oHttp := CreateObject( 'MSXML2.XMLHTTP' )
    oHttp:Open( 'POST', "https://dev.wetransfer.com/v2/authorize", .F. )
    ohttp:SetRequestHeader( "Content-Type" , "application/json" )  
    oHttp:SetRequestHeader( "x-api-key","api_key")
    oHttp:Send()
    cText:=alltrim(ohttp:responseText)
]]>

I'm not test, but i will check the example.

Try this.

CODE: Select all

    oHttp := CreateObject( 'MSXML2.XMLHTTP' )
    oHttp:Open( 'POST', "https://dev.wetransfer.com/v2/authorize", .F. )
    ohttp:SetRequestHeader( "Content-Type" , "application/json" )  
    oHttp:SetRequestHeader( "x-api-key","api_key")
    oHttp:Send()
    cText:=alltrim(ohttp:responseText)
]]>
<![CDATA[General :: Re: Combobox control :: Reply by serge_girard]]> 2018-10-16T04:33:39-04:00 2018-10-16T04:33:39-04:00 http://www.hmgforum.com/viewtopic.php?f=24&t=5825&p=56476#p56476
I doubt if it possible. Documentation doesn't mention.
What you can do is deleting all items and re-add with items (true), a bit tricky.

Serge]]>

I doubt if it possible. Documentation doesn't mention.
What you can do is deleting all items and re-add with items (true), a bit tricky.

Serge]]>
<![CDATA[General :: Re: Combobox control :: Reply by esgici]]> 2018-10-16T05:21:51-04:00 2018-10-16T05:21:51-04:00 http://www.hmgforum.com/viewtopic.php?f=24&t=5825&p=56477#p56477 DISPLAYEDIT property :arrow:

As soon as I remember .F. value means "Read Only" and default value of this property is .F.

Attention: <lValue> usable in alternate ( DEFINE ... ENDDEFINE) syntax; @ x, y syntax not accept <lValue>; using only keyword means .T.

My little sample Dynamic Combobox may be useful.

Happy HMG'ing :D]]>
DISPLAYEDIT property :arrow:

As soon as I remember .F. value means "Read Only" and default value of this property is .F.

Attention: <lValue> usable in alternate ( DEFINE ... ENDDEFINE) syntax; @ x, y syntax not accept <lValue>; using only keyword means .T.

My little sample Dynamic Combobox may be useful.

Happy HMG'ing :D]]>
<![CDATA[General :: Re: Combobox control :: Reply by serge_girard]]> 2018-10-16T06:58:14-04:00 2018-10-16T06:58:14-04:00 http://www.hmgforum.com/viewtopic.php?f=24&t=5825&p=56479#p56479

CODE: Select all

#include "hmg.ch"
 

FUNCTION MAIN()
/**************/
DEFINE WINDOW Form_1 ; 
   AT 0,0	           ;
   WIDTH  550	;  
   HEIGHT 300  ;
   TITLE 'Languages'  ;
   ICON  ""	;
   MAIN

   ON KEY ESCAPE  ACTION Form_1.Release  



   DEFINE RADIOGROUP Radio_1
      OPTIONS { 'Roman' , 'Germanic' , 'Slavic', 'Turkish' }  /* etcera */	
      VALUE 1
      WIDTH 100
      TOOLTIP 'Languages'
      ROW 10
      COL 10
      ON CHANGE Fill_CB_1()
   END RADIOGROUP


   DEFINE COMBOBOX CB_1
      ROW 10
      COL 120
      WIDTH 140
      HEIGHT 25
      ITEMS {'FR',  'ES' ,   'IT' }  // DEFAULT
      VALUE 1
   END COMBOBOX

END WINDOW 


Form_1.center
Form_1.activate

RETURN NIL






FUNCTION Fill_CB_1()
/******************/

Form_1.CB_1.DeleteAllItems()
DO CASE 
CASE Form_1.Radio_1.Value == 1 // ROMAN
   Form_1.CB_1.AddItem( 'FR' )
   Form_1.CB_1.AddItem( 'ES' )
   Form_1.CB_1.AddItem( 'IT' )

CASE Form_1.Radio_1.Value == 2 // GERMANIC
   Form_1.CB_1.AddItem( 'DE' )
   Form_1.CB_1.AddItem( 'EN' )
   Form_1.CB_1.AddItem( 'NL' )

CASE Form_1.Radio_1.Value == 3 // SLAVIC
   Form_1.CB_1.AddItem( 'SK' )
   Form_1.CB_1.AddItem( 'RU' )
   Form_1.CB_1.AddItem( 'BU' )

CASE Form_1.Radio_1.Value == 4 // TURKISH
   Form_1.CB_1.AddItem( 'TR' )

OTHERWISE
   /* etcera */	
ENDCASE
Form_1.CB_1.Value := 1
RETURN

Serge]]>

CODE: Select all

#include "hmg.ch"
 

FUNCTION MAIN()
/**************/
DEFINE WINDOW Form_1 ; 
   AT 0,0	           ;
   WIDTH  550	;  
   HEIGHT 300  ;
   TITLE 'Languages'  ;
   ICON  ""	;
   MAIN

   ON KEY ESCAPE  ACTION Form_1.Release  



   DEFINE RADIOGROUP Radio_1
      OPTIONS { 'Roman' , 'Germanic' , 'Slavic', 'Turkish' }  /* etcera */	
      VALUE 1
      WIDTH 100
      TOOLTIP 'Languages'
      ROW 10
      COL 10
      ON CHANGE Fill_CB_1()
   END RADIOGROUP


   DEFINE COMBOBOX CB_1
      ROW 10
      COL 120
      WIDTH 140
      HEIGHT 25
      ITEMS {'FR',  'ES' ,   'IT' }  // DEFAULT
      VALUE 1
   END COMBOBOX

END WINDOW 


Form_1.center
Form_1.activate

RETURN NIL






FUNCTION Fill_CB_1()
/******************/

Form_1.CB_1.DeleteAllItems()
DO CASE 
CASE Form_1.Radio_1.Value == 1 // ROMAN
   Form_1.CB_1.AddItem( 'FR' )
   Form_1.CB_1.AddItem( 'ES' )
   Form_1.CB_1.AddItem( 'IT' )

CASE Form_1.Radio_1.Value == 2 // GERMANIC
   Form_1.CB_1.AddItem( 'DE' )
   Form_1.CB_1.AddItem( 'EN' )
   Form_1.CB_1.AddItem( 'NL' )

CASE Form_1.Radio_1.Value == 3 // SLAVIC
   Form_1.CB_1.AddItem( 'SK' )
   Form_1.CB_1.AddItem( 'RU' )
   Form_1.CB_1.AddItem( 'BU' )

CASE Form_1.Radio_1.Value == 4 // TURKISH
   Form_1.CB_1.AddItem( 'TR' )

OTHERWISE
   /* etcera */	
ENDCASE
Form_1.CB_1.Value := 1
RETURN

Serge]]>
<![CDATA[General :: Re: Combobox control :: Reply by Georg_BA]]> 2018-10-16T14:52:42-04:00 2018-10-16T14:52:42-04:00 http://www.hmgforum.com/viewtopic.php?f=24&t=5825&p=56489#p56489 The delete solution does not suit me, I created a condition based on the COMBOBOX.value return value. In some parts, I need only 1 value active but the value should be 5]]> The delete solution does not suit me, I created a condition based on the COMBOBOX.value return value. In some parts, I need only 1 value active but the value should be 5]]> <![CDATA[General Discussions :: Re: Happy Birthday to Gilbert (karweru)! :: Reply by esgici]]> 2018-10-16T04:23:11-04:00 2018-10-16T04:23:11-04:00 http://www.hmgforum.com/viewtopic.php?f=12&t=5824&p=56475#p56475
serge_girard wrote:
Tue Oct 16, 2018 7:35 am
Happy Birthday to Gilbert (karweru)!

Serge
Happy birthday brother :D

Salutes from Turkiye 8-)]]>
serge_girard wrote:
Tue Oct 16, 2018 7:35 am
Happy Birthday to Gilbert (karweru)!

Serge
Happy birthday brother :D

Salutes from Turkiye 8-)]]>
<![CDATA[General Discussions :: Re: Happy Birthday to Gilbert (karweru)! :: Reply by koke]]> 2018-10-16T08:20:53-04:00 2018-10-16T08:20:53-04:00 http://www.hmgforum.com/viewtopic.php?f=12&t=5824&p=56480#p56480 <![CDATA[General Discussions :: Re: Happy Birthday to Gilbert (karweru)! :: Reply by srvet_claudio]]> 2018-10-16T09:51:34-04:00 2018-10-16T09:51:34-04:00 http://www.hmgforum.com/viewtopic.php?f=12&t=5824&p=56485#p56485 <![CDATA[General Discussions :: Re: Happy Birthday to Gilbert (karweru)! :: Reply by luisvasquezcl]]> 2018-10-16T12:10:23-04:00 2018-10-16T12:10:23-04:00 http://www.hmgforum.com/viewtopic.php?f=12&t=5824&p=56486#p56486 <![CDATA[General Discussions :: Re: Happy Birthday to Gilbert (karweru)! :: Reply by mol]]> 2018-10-16T13:09:09-04:00 2018-10-16T13:09:09-04:00 http://www.hmgforum.com/viewtopic.php?f=12&t=5824&p=56487#p56487 <![CDATA[General Discussions :: Re: Happy Birthday to Gilbert (karweru)! :: Reply by Steed]]> 2018-10-16T23:28:00-04:00 2018-10-16T23:28:00-04:00 http://www.hmgforum.com/viewtopic.php?f=12&t=5824&p=56490#p56490