Is this a bug ?

Moderator: Rathinagiri

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

Re: Is this a bug ?

Post by Rathinagiri »

Roberto Lopez wrote:
rathinagiri wrote:So, I need not do so, in future. That's nice. Thank you Roberto.
Please, if you find a control that not work so, report the problem.

Regards,

Roberto.
I am afraid combo box control's on change event is not fired when the value is changed through the code. I had linked three combo boxes in the following example. Initial value is changed using 'main.combo_1.value := 1' after adding some items. But on change event is not fired at all.

This is main.prg

Code: Select all

#include <minigui.ch>

Function Main

        Load Window Main
        main.combo_1.deleteallitems()
        main.combo_1.additem("One")
        main.combo_1.additem("Two")
        main.combo_1.additem("Three")
        main.combo_1.value := 1
        Main.Center
        Main.Activate
Return

function combo1changed
main.combo_2.deleteallitems()
if main.combo_1.value > 0
   for i := 1 to 5
      main.combo_2.additem(main.combo_1.item(main.combo_1.value)+str(i))
   next i
   main.combo_2.value := 1
endif   
return nil

function combo2changed
main.combo_3.deleteallitems()
if main.combo_2.value > 0
   for i := 1 to 3
      main.combo_3.additem(main.combo_2.item(main.combo_2.value)+str(i))
   next i
   main.combo_3.value := 1
endif   
return nil


function combo3changed
msginfo("Here")
return nil
This is main.hmg

Code: Select all

* Harbour MiniGUI IDE Two-Way Form Designer Generated Code
* (c)2004-2008 Roberto Lopez <harbourminigui@gmail.com>
* http://harbourminigui.googlepages.com

DEFINE WINDOW TEMPLATE AT 131 , 232 WIDTH 550 HEIGHT 350 VIRTUAL WIDTH Nil VIRTUAL HEIGHT Nil TITLE "" ICON NIL MAIN CURSOR NIL ON INIT Nil ON RELEASE Nil ON INTERACTIVECLOSE Nil ON MOUSECLICK Nil ON MOUSEDRAG Nil ON MOUSEMOVE Nil ON SIZE Nil ON MAXIMIZE Nil ON MINIMIZE Nil ON PAINT Nil BACKCOLOR Nil NOTIFYICON NIL NOTIFYTOOLTIP NIL ON NOTIFYCLICK Nil ON GOTFOCUS Nil ON LOSTFOCUS Nil ON SCROLLUP Nil ON SCROLLDOWN Nil ON SCROLLLEFT Nil ON SCROLLRIGHT Nil ON HSCROLLBOX Nil ON VSCROLLBOX Nil

    DEFINE COMBOBOX Combo_1
        ROW    80
        COL    150
        WIDTH  100
        HEIGHT 100
        ITEMS {""}
        VALUE 0
        FONTNAME "Arial"
        FONTSIZE 9
        TOOLTIP ""
        ONCHANGE combo1changed()
        ONGOTFOCUS Nil
        ONLOSTFOCUS Nil
        FONTBOLD .F.
        FONTITALIC .F.
        FONTUNDERLINE .F.
        FONTSTRIKEOUT .F.
        HELPID Nil
        TABSTOP .T.
        VISIBLE .T.
        SORT .F.
        ONENTER Nil
        ONDISPLAYCHANGE Nil
        DISPLAYEDIT .F.
        IMAGE Nil
        DROPPEDWIDTH Nil
        ONDROPDOWN Nil
        ONCLOSEUP Nil
    END COMBOBOX

    DEFINE COMBOBOX Combo_2
        ROW    80
        COL    270
        WIDTH  100
        HEIGHT 100
        ITEMS {""}
        VALUE 0
        FONTNAME "Arial"
        FONTSIZE 9
        TOOLTIP ""
        ONCHANGE combo2changed()
        ONGOTFOCUS Nil
        ONLOSTFOCUS Nil
        FONTBOLD .F.
        FONTITALIC .F.
        FONTUNDERLINE .F.
        FONTSTRIKEOUT .F.
        HELPID Nil
        TABSTOP .T.
        VISIBLE .T.
        SORT .F.
        ONENTER Nil
        ONDISPLAYCHANGE Nil
        DISPLAYEDIT .F.
        IMAGE Nil
        DROPPEDWIDTH Nil
        ONDROPDOWN Nil
        ONCLOSEUP Nil
    END COMBOBOX

    DEFINE COMBOBOX Combo_3
        ROW    80
        COL    390
        WIDTH  100
        HEIGHT 100
        ITEMS {""}
        VALUE 0
        FONTNAME "Arial"
        FONTSIZE 9
        TOOLTIP ""
        ONCHANGE combo3changed()
        ONGOTFOCUS Nil
        ONLOSTFOCUS Nil
        FONTBOLD .F.
        FONTITALIC .F.
        FONTUNDERLINE .F.
        FONTSTRIKEOUT .F.
        HELPID Nil
        TABSTOP .T.
        VISIBLE .T.
        SORT .F.
        ONENTER Nil
        ONDISPLAYCHANGE Nil
        DISPLAYEDIT .F.
        IMAGE Nil
        DROPPEDWIDTH Nil
        ONDROPDOWN Nil
        ONCLOSEUP Nil
    END COMBOBOX

END WINDOW
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
User avatar
Roberto Lopez
HMG Founder
Posts: 4010
Joined: Wed Jul 30, 2008 6:43 pm

Re: Is this a bug ?

Post by Roberto Lopez »

rathinagiri wrote:
I am afraid combo box control's on change event is not fired when the value is changed through the code. I had linked three combo boxes in the following example. Initial value is changed using 'main.combo_1.value := 1' after adding some items. But on change event is not fired at all.
Ok.

When 2.8.8 be published, I'll start 'hunting' OnChange problems and we talk here about impact on backwards compatibility of these fixes (I guess that RadioGroup has the same problem too).

Thanks for the report.

Regards,

Roberto.
Regards/Saludos,

Roberto


(Veritas Filia Temporis)
Post Reply