Word wrap in EditBox

EDITBOX control doesn’t have a WORD-WRAP property but has this feature via HSCROLLBAR property.

Look at the sample :

/*
*  HMG – Harbour Win32 GUI library Demo
*
*  Copyright 2010 Roberto Lopez
*
HMG official EDITBOX demo slightly modified to demonstrate effect of HSCROLLBAR property.

*/

#include "hmg.ch"
Function Main
   LOCAL cTestText := STRTRAN( TestText(), CRLF, '' ) 

   DEFINE WINDOW Form_1 ;
      AT 0,0 ;
      WIDTH 640 HEIGHT 480 ;
      TITLE 'HMG EditBox!! Demo' ;
      MAIN 

      ON KEY ESCAPE ACTION Form_1.Release
      DEFINE STATUSBAR
         STATUSITEM 'HMG Power Ready!' 
      END STATUSBAR
      @ 30,10 EDITBOX Edit_1 ;
        WIDTH 600 ;
        HEIGHT 170 ;
        VALUE cTestText ;
        TOOLTIP 'EDITBOX with HSCROLLBAR is .T.'
      @ 230,10 EDITBOX Edit_2 ;
        WIDTH 600 ;
        HEIGHT 170 ;
        VALUE cTestText ;
        TOOLTIP 'EDITBOX with HSCROLLBAR is .F.' ;
        NOHSCROLL
  END WINDOW
  Form_1.Center()
  Form_1.Activate()

Return Nil
FUNCTION TestText()
    RETURN "HMG 2.0 ALPHA BUILD 004 Changelog: "+;
           "- New: Cell ( nRow , nCol ) property for GRID control (read(write). "+;
           "- New: Edit routines for GRID control. Editing is now 'in-cell'. "+;
           "- New: 'DynamicForeColor' / 'DynamicBackColor' properties for GRID "+;
           "control. Codeblock array (one element per column) evaluated "+;
           "for each cell at any grid change. "+;
           "This.CellRowIndex, This.CellColIndex and This.CellValue variables are "+;
           "available at codeblock evaluation. "+;
           "Sample: "+;
           "bColor := { || if ( This.CellRowIndex/2 == int(This.CellRowIndex/2) , ; "+;
           "RGB (128,128,128) , RGB (192,192,192) ) } "+;
           "DYNAMICBACKCOLOR { bColor , bColor, bColor, bColor, bColor, bColor } "+;
           "See \hmg\samples\grid\grid_10 "+;
           "\hmg\samples\grid\grid_11 "+;
           "\hmg\samples\grid\grid_12 "

Advertisements

Mini Agenda

This is a mini application developed primarily to denote some wonderful features of HMG.

Mini Agenda uses:

– A text (csv)  file for data source and Grid as browse of this file

– DEFINE ACTIVEX for “About” page from a .html file

– HFCL library ( Thanks to S. Rathinagiri for GridPrint )

Features :

– File operations: New, Open, ReOpen, Close, Save, Save as, Print

– Record operations:  Append, Delete, Insert

– Three way ( Natural, Ascending, Descending) sorting columns

– Preserve current item after sort

– In_place editing

– Incremental (and “soft” ) Search

– .ini File for keeping record of last used data file

Download : source, executable.

Message multiple values

MsgMulti ( aka MsM) is a message function accept multiple and any type of data.

Download here ( source only ).

EditBox Control

HMG Tutor 13

Getting Large Text (The EditBox Control)

 

The EditBox control allows to handle large (multiline) text data.

@ 10,10 EDITBOX Edit_1 ;
        WIDTH 300 ;
        HEIGHT 150

#include "hmg.ch"
Function Main
DEFINE WINDOW Win_1 ;
   AT 0,0 ;
   WIDTH 400 ;
   HEIGHT 300 ;
   TITLE 'Tutor 13 EditBox Test' ;
   MAIN
   DEFINE MAIN MENU
      POPUP "First Popup"
         ITEM 'Change EditBox Content' ACTION  ;
               Win_1.Edit_1.Value := 'New EditBox Value'
         ITEM 'Retrieve EditBox Content' ACTION  ;
               MsgInfo ( Win_1.Edit_1.Value)
      END POPUP
   END MENU
   @ 10,10 EDITBOX Edit_1 ;
           WIDTH 300 ;
           HEIGHT 150
END WINDOW
ACTIVATE WINDOW Win_1
Return