Splitbox and Texbox Control Problem

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

Post Reply
jayadevu
Posts: 240
Joined: Tue May 19, 2009 7:10 am

Splitbox and Texbox Control Problem

Post by jayadevu »

Hi,

Please consider the following code:

Code: Select all

#include "minigui.ch"

Function SplitTextBox
   DEFINE WINDOW FrmMain at 0,0 HEIGHT 480 WIDTH 640 MAIN
   DEFINE SPLITBOX OF FrmMain
      DEFINE TOOLBAR ToolBar_1 ;
            BUTTONSIZE IF(IsThemed(), 28, 25), 25 ;
            FLAT //RIGHTTEXT
            BUTTON TB1_Button_1 ;
               TOOLTIP "Search" ;
               PICTURE 'FIND' ;
               ACTION Msgbox("Search Clicked")
            BUTTON TB1_Button_2 ;
               TOOLTIP 'Filter Records' ;
               PICTURE 'FILTER' ;
               ACTION MsgBox("Filter Clicked") ;
               SEPARATOR
            END TOOLBAR
            DEFINE TEXTBOX tbxSearch
              // unless the col is mentioned,
              // textbox control overwrites the other toolbar buttons
              // COL 100
               WIDTH  250
               height 24
                ON CHANGE MsgBox("Textbox clicked")
             END TEXTBOX
         END SPLITBOX

   END WINDOW
   FrmMain.Activate
return NIL
If you compile and link the above code, you will find that the textbox overwrites the toolbar buttons unless the 'COL" is specified in textbox control. With other controls like combobox this does not happen. Is this by design or I have missed something.

Warm regards,

Jayadev
User avatar
Rathinagiri
Posts: 5482
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: Splitbox and Texbox Control Problem

Post by Rathinagiri »

Yes, 'TEXTBOX' is purposefully omitted! I don't know why either.

This is the extract from the documentation:

Code: Select all

Controls / Windows defined as part of this container can be arranged

      by users, using a gripperbar located at control's left side. It can be

      used with listbox, grid, editbox, tree, browse, combobox, toolbar and

      'SplitChild' windows. You must omit '@ <row>,<col>' in control

      definition. 
However, as a work around, you can use an editbox without col definition!

Just remove horizontal and vertical scrollbars with this:

Code: Select all

   hscrollbar .f.
   vscrollbar .f.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
jayadevu
Posts: 240
Joined: Tue May 19, 2009 7:10 am

Re: Splitbox and Texbox Control Problem

Post by jayadevu »

Dear Rathinagiri,

Many thanks for your reply. I shall try the editbox control in splitbox.

Warm regards,

Jayadev
jayadevu
Posts: 240
Joined: Tue May 19, 2009 7:10 am

Re: Splitbox and Texbox Control Problem

Post by jayadevu »

Dear Rathinagiri,

In the following code, the edit box occupies a seperate line by itself. Please review.

Code: Select all

#include "minigui.ch"

Function SplitTextBox
   DEFINE WINDOW FrmMain at 0,0 HEIGHT 480 WIDTH 640 MAIN
   DEFINE SPLITBOX OF FrmMain
      DEFINE TOOLBAR ToolBar_1 ;
            BUTTONSIZE IF(IsThemed(), 28, 25), 25 ;
            FLAT //RIGHTTEXT
            BUTTON TB1_Button_1 ;
               TOOLTIP "Search" ;
               PICTURE 'FIND' ;
               ACTION Msgbox("Search Clicked")
            BUTTON TB1_Button_2 ;
               TOOLTIP 'Filter Records' ;
               PICTURE 'FILTER' ;
               ACTION MsgBox("Filter Clicked") ;
               SEPARATOR
         END TOOLBAR
         EDITBOX Edit_1 WIDTH 100 VALUE "Test EditBox" HEIGHT 24 NOVSCROLL NOHSCROLL ON CHANGE Msgbox("TextBox Clicked")
           /*
            DEFINE TEXTBOX tbxSearch
              // unless the col is mentioned,
              // textbox control overwrites the other toolbar buttons
              // COL 100
               WIDTH  250
               height 24
                ON CHANGE MsgBox("Textbox clicked")
             END TEXTBOX
            */
         END SPLITBOX

   END WINDOW
   FrmMain.Activate
return NIL
Warm regards,

Jayadev
Post Reply