Alpha Software Mobile Development Tools:   Alpha Anywhere    |   Alpha TransForm subscribe to our YouTube Channel  Follow Us on LinkedIn  Follow Us on Twitter  Follow Us on Facebook

Announcement

Collapse

The Alpha Software Forum Participation Guidelines

The Alpha Software Forum is a free forum created for Alpha Software Developer Community to ask for help, exchange ideas, and share solutions. Alpha Software strives to create an environment where all members of the community can feel safe to participate. In order to ensure the Alpha Software Forum is a place where all feel welcome, forum participants are expected to behave as follows:
  • Be professional in your conduct
  • Be kind to others
  • Be constructive when giving feedback
  • Be open to new ideas and suggestions
  • Stay on topic


Be sure all comments and threads you post are respectful. Posts that contain any of the following content will be considered a violation of your agreement as a member of the Alpha Software Forum Community and will be moderated:
  • Spam.
  • Vulgar language.
  • Quotes from private conversations without permission, including pricing and other sales related discussions.
  • Personal attacks, insults, or subtle put-downs.
  • Harassment, bullying, threatening, mocking, shaming, or deriding anyone.
  • Sexist, racist, homophobic, transphobic, ableist, or otherwise discriminatory jokes and language.
  • Sexually explicit or violent material, links, or language.
  • Pirated, hacked, or copyright-infringing material.
  • Encouraging of others to engage in the above behaviors.


If a thread or post is found to contain any of the content outlined above, a moderator may choose to take one of the following actions:
  • Remove the Post or Thread - the content is removed from the forum.
  • Place the User in Moderation - all posts and new threads must be approved by a moderator before they are posted.
  • Temporarily Ban the User - user is banned from forum for a period of time.
  • Permanently Ban the User - user is permanently banned from the forum.


Moderators may also rename posts and threads if they are too generic or do not property reflect the content.

Moderators may move threads if they have been posted in the incorrect forum.

Threads/Posts questioning specific moderator decisions or actions (such as "why was a user banned?") are not allowed and will be removed.

The owners of Alpha Software Corporation (Forum Owner) reserve the right to remove, edit, move, or close any thread for any reason; or ban any forum member without notice, reason, or explanation.

Community members are encouraged to click the "Report Post" icon in the lower left of a given post if they feel the post is in violation of the rules. This will alert the Moderators to take a look.

Alpha Software Corporation may amend the guidelines from time to time and may also vary the procedures it sets out where appropriate in a particular case. Your agreement to comply with the guidelines will be deemed agreement to any changes to it.



Bonus TIPS for Successful Posting

Try a Search First
It is highly recommended that a Search be done on your topic before posting, as many questions have been answered in prior posts. As with any search engine, the shorter the search term, the more "hits" will be returned, but the more specific the search term is, the greater the relevance of those "hits". Searching for "table" might well return every message on the board while "tablesum" would greatly restrict the number of messages returned.

When you do post
First, make sure you are posting your question in the correct forum. For example, if you post an issue regarding Desktop applications on the Mobile & Browser Applications board , not only will your question not be seen by the appropriate audience, it may also be removed or relocated.

The more detail you provide about your problem or question, the more likely someone is to understand your request and be able to help. A sample database with a minimum of records (and its support files, zipped together) will make it much easier to diagnose issues with your application. Screen shots of error messages are especially helpful.

When explaining how to reproduce your problem, please be as detailed as possible. Describe every step, click-by-click and keypress-by-keypress. Otherwise when others try to duplicate your problem, they may do something slightly different and end up with different results.

A note about attachments
You may only attach one file to each message. Attachment file size is limited to 2MB. If you need to include several files, you may do so by zipping them into a single archive.

If you forgot to attach your files to your post, please do NOT create a new thread. Instead, reply to your original message and attach the file there.

When attaching screen shots, it is best to attach an image file (.BMP, .JPG, .GIF, .PNG, etc.) or a zip file of several images, as opposed to a Word document containing the screen shots. Because Word documents are prone to viruses, many message board users will not open your Word file, therefore limiting their ability to help you.

Similarly, if you are uploading a zipped archive, you should simply create a .ZIP file and not a self-extracting .EXE as many users will not run your EXE file.
See more
See less

No xdialog killfocus event for combo box

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    #16
    Re: No xdialog killfocus event for combo box

    Thanks Ira,
    Your event example is eye opening and extremely helpful. No wonder I couldn't get a handle on this! I am working on a record entry dialog with events to check the integrity of the entered values with table lookups for presenting the user existing values. I see now the change event for the combo box does fire twice. OK.. maybe _changing will work... I'll move on to figure out what to do. Thanks again.

    David,
    Good thought but the table event is table.external_record_content_get() which opens and closes the table and would not be available for testing in the manner you have shown. But could be differently.

    Gabriel,
    Well, having studied this and having looked at Selwyns and looked at Ira examples, I'd have to disagree with you. Entering a value into a combo box (^=) DOES generate 2 change events. It just does. One ChangING event, but 2 change events.
    Last edited by Mike Wilson; 03-30-2010, 11:51 AM.
    Mike W
    __________________________
    "I rebel in at least small things to express to the world that I have not completely surrendered"

    Comment


      #17
      Re: No xdialog killfocus event for combo box

      But, I don't think table.external_record_content_get() would make a difference... would it? Not sure.

      I'm just passing through the code setting a logical variable... if you've been there once before... don't do it again. Probably lots of better ways to do it.

      Comment


        #18
        Re: No xdialog killfocus event for combo box

        David,

        Here is a modified code so that the change event only fires once. Not sure this is what your want, but figured I would offer the solution up for you.

        Code:
        ' field variables
        	dim vdlg_f1 as C=""
        	dim vdlg_f2 as C=""
        	dim vF1_list as C=comma_to_crlf("Arabic,Greek")
        	dim vLArabic as C=comma_to_crlf("one,two,three,four,five,six")
        	dim vLGreek as C=comma_to_crlf("alpha,beta,gamma,delta,epsilon")
        	dim vF2_list as C=""
        
        ' dialog variables
        	dim vresult as C 
        	dim dlg_title as C="Document Entry"
        	dim dlg_body as C
        	dim dlg_code as C
        
        ' build the dialog
        	dlg_body = <<%dlg%
        	{region}
        	{lf};
        	Dialog Field 1: | {initial_focus} [.20dlg_f1^=vF1_list!f1ev];
        	Dialog Field 2: | [.20,10dlg_f2^#vF2_list];
        	{endregion};
        	{lf};
        	{lf};
        	{justify=center}<15OK> <15Cancel>
        	%dlg%
        
        	dlg_code=<<%code%
        'FIELD 1
        	IF a_dlg_button="f1ev"
        		IF dlg_f1="Arabic"
        			vF2_list=vLArabic
        		ELSE
        			vF2_list=vLGreek
        		END IF
        		
        		msgbox("The table is being accessed ")
        
        	a_dlg_button=""
        	END IF
        	%code%
        	
        vresult=ui_dlg_box(dlg_title, dlg_body,dlg_code)

        Hope this helps ..

        Scott

        Comment


          #19
          Re: No xdialog killfocus event for combo box

          How curious: A change event fires two times.

          My first thought was it must be the combo box.
          but you changed the format of the event handler.

          It just like David stated: I almost get it, but then again, not really.


          Who can explain why the change event fired two times?

          Ton
          Most things are simple but unfortunately only after the first time

          Comment


            #20
            Re: No xdialog killfocus event for combo box

            It even gets more complicated/curious/elusive than what it appears.....I have spent an inordinate amount of time working through this.

            And Gabriel was correct... and I stand corrected.

            While the a_dialog_button appears to acquire the value of 'change' twice with a selection in a combo box, as Ira's very fine example shows it as twice, if you have code that is located within an if a_dlg_button="xxx_change" section...(see vcycle count) it only executes the code in this section once... as far as I can see, even thought the event is seen as twice.

            Code:
            dim dlg_title as c="XDialog Events"
            dim vLF1 as C="Arabic"+crlf()+"Greek"
            dim vF1 as C=""
            dim vLF2 as C=""
            dim vF3 as C
            dim vF2 as C
            dim vLB as C						' list to fill list box
            dim vLBK as C						' list box pick
            dim vLArabic as C=comma_to_crlf("one,two,three,four,five,six")
            dim vLGreek as C=comma_to_crlf("alpha,beta,gamma,delta,epsilon")
            dim vcycle as N=0
            dim dlg_body as c
            
            dim vctrl_f2 as C="[.20vF2^+vLF2!field2evt_*]"
            
            dlg_body=<<%dlg%
            {startup=init}
            {can_exit=close}
            {region}
            Combo:|[.20vF1^=vLF1!field1evt_*];
            Edit Combo:|[.20vF2^+vLF2!field2evt_*];
            Field3:|[.20vF3!field3ev_*];
            List:|[.20,10vLBK^#vLB!listevt_*];
            {endregion};
            Dialog Event List;
            {text=40,20vLevent1};
            {region}
            <OK> <Cancel> <Reset List!Reset>
            {endregion};
            %dlg%
            
            dim dlg_code as c
            dlg_code=<<%code%
            IF a_dlg_button="Cancel" .or. a_dlg_button="OK"
                ui_modeless_dlg_close(dlg_title)
            ELSE IF a_dlg_button="Reset"
                vLevent=""
                vLB=""
                vF1=""
                vF2=""
                ui_dlg_ctl_goto(dlg_title,"[.20vF1^=vLF1!field1evt_*]")
            ELSE IF a_dlg_button=="INIT"
                ' Dialog code initialized
                vLevent=""
                ' Generate list of past 20 events 
                vLevent1=word(vLevent,max(1,line_count(vLevent)-20),crlf(),20)
                vLevent1=vLevent
            ELSE
                ' Add event for those variable we want to see
                 vLevent=vLevent+a_dlg_button+"........."+vF1+"..."+str(vcycle)+Crlf()
                ' Only show most recent 20 lines of events
                vLevent1=word(vLevent,max(1,line_count(vLevent)-20),crlf(),20)
                vLevent1=vLevent
            END IF
            
            'xxxxxxxxxxxxxxxxx
            IF left(a_dlg_button,10)="field1evt_"
              IF a_dlg_button="field1evt_change"
            	ui_dlg_ctl_goto(dlg_title,vctrl_f2)
              END IF
             a_dlg_button=""
            END IF
              
            IF left(a_dlg_button,10)="field2evt_"
              IF a_dlg_button="field2evt_setfocus"
               	if vF1="arabic"
            		vLB=vLArabic
            	else
            		vLB=vLGreek
            	end if
             	vLF2=vLB
             	vcycle=vcycle+1
              END IF  
             a_dlg_button=""
            END IF
            
            IF left(a_dlg_button,8)="listevt_"
            	vF2=vLBK
            END IF
            	
            a_dlg_button=""
            
            END
            %code%
            
            dim vLevent as c
            dim vLevent1 as c
            dim evt as c
            
            ' Display as modeless, as we can look at it and modify code while open
            ui_modeless_dlg_box(dlg_title,dlg_body,dlg_code)
            Last edited by Mike Wilson; 03-30-2010, 11:45 PM.
            Mike W
            __________________________
            "I rebel in at least small things to express to the world that I have not completely surrendered"

            Comment


              #21
              Re: No xdialog killfocus event for combo box

              "...Your honor, members of the jury:
              My client Mike Wilson is an innocent man..he is accused of witchcraft.... he is accused of doing the Devil's work.... only the devil could make one equals two or two equals one... he makes one change but the darn thing fires "twice"... it sure looks like the devil's work, but I assure you he is an innocent man..he is not a heretic..I know some have already attempted to defend him only to implicate him further but I have physical evidence that will exonerate him.. Exhibit A, Exhibit B and many more.."


              Note to Mike:
              Mike:
              This angry mob will burn you at the stake..these are serious charges and unfortunately it is not looking good for you. It sure looks like witchcraft, I told you that earlier.. You are running out of time but I am sure I could get you off. Do you want me to defend you? Or do you want to be your own lawyer?

              Comment


                #22
                Re: No xdialog killfocus event for combo box

                Gabriel,
                You are a true patriot and honorable citizen. Thank you for your noble offer. However, I have decided not to fight further but to take the few tools and modicum of understanding I have garnered in my harrowing explorations into xdialog events and get the h@*l out of Dodge and run for the hills!! No more time can be spent on that which can only be molified by an exorcism.
                Mike W
                __________________________
                "I rebel in at least small things to express to the world that I have not completely surrendered"

                Comment


                  #23
                  Re: No xdialog killfocus event for combo box

                  Too bad.. you are almost there..
                  I am sure the issue will come up again and again in one form or another.

                  Comment


                    #24
                    Re: No xdialog killfocus event for combo box

                    The kill focus bug for edit combo boxes is now fixed. Will be in next update.

                    Comment


                      #25
                      Re: No xdialog killfocus event for combo box

                      Thanks Selwyn.
                      Mike W
                      __________________________
                      "I rebel in at least small things to express to the world that I have not completely surrendered"

                      Comment


                        #26
                        Re: No xdialog killfocus event for combo box

                        What is the latest position/behaviour of kill_focus event on xdialog combo box???

                        I am trying with the latest version but kill_focus doesnot seem to work!
                        Version 11, Build 3044
                        Ozgur Ugur
                        Computer Eng.
                        Data Yazilim Ltd.
                        Izmir - Turkiye

                        Comment


                          #27
                          Re: No xdialog killfocus event for combo box

                          please send a sample. there is another sample xdialog at the top of this thread and the killfocus event in that sample is working.

                          Comment


                            #28
                            Re: No xdialog killfocus event for combo box

                            Selwyn,
                            Here is the code I try to execute. At the end you will see the table definition and sample data.
                            Thanks



                            'DIM vKullanici as C=comma_to_crlf("OZGUR,AHMET,SELWYN,RICHARD")

                            DIM global prm_kullanici as C
                            DIM global prm_parola as C
                            DIM global prm_sube as C
                            DIM global prm_kasa as C
                            DIM SHARED varC_result as C

                            ok_button_label = "&Tamam"
                            cancel_button_label = "&Vazge�"

                            varC_result = ui_dlg_box("Sisteme giriş",<<%dlg%
                            {region}
                            {lf};
                            Kullanıcı| [%k=klnc,{keylist_build('1:25', kullanici, kullanici)}%25prm_kullanici!kul_*];
                            �alışılacak şube| [.25prm_sube!sb_*];
                            �alışılacak kasa| [.25prm_kasa!ks_*];
                            {lf};
                            {endregion};

                            {line=1,0};

                            {region}
                            {lf};
                            <18=ok_button_label!OK> <18=cancel_button_label!CANCEL>
                            {endregion};
                            %dlg%,<<%code%
                            if a_dlg_button = "kul_killfocus"
                            if prm_kullanici=""
                            ui_modeless_dlg_box("Message",<<%dlg%
                            {nocaption}{background=yellow}
                            {region}
                            Kullanıcı se�in...
                            {endregion};
                            %dlg%)
                            xbasic_wait_for_idle()
                            sleep(1)
                            ui_modeless_dlg_close("Message")
                            ui_dlg_ctl_goto("Sisteme giriş","prm_kullanici")
                            a_dlg_button=""
                            else
                            msgbox("","deneme")
                            end if
                            else if a_dlg_button= "OK"
                            if prm_kullanici=""
                            ui_modeless_dlg_box("Message",<<%dlg%
                            {nocaption}{background=yellow}
                            {region}
                            Kullanıcı se�in...
                            {endregion};
                            %dlg%)
                            xbasic_wait_for_idle()
                            sleep(1)
                            ui_modeless_dlg_close("Message")
                            ui_dlg_ctl_goto("Sisteme giriş","prm_kullanici")
                            a_dlg_button=""
                            else if prm_sube=""
                            ui_modeless_dlg_box("Message",<<%dlg%
                            {nocaption}{background=yellow}
                            {region}
                            Şube se�in...
                            {endregion};
                            %dlg%)
                            xbasic_wait_for_idle()
                            sleep(1)
                            ui_modeless_dlg_close("Message")
                            ui_dlg_ctl_goto("Sisteme giriş","prm_sube")
                            a_dlg_button=""
                            else if prm_kasa=""
                            ui_modeless_dlg_box("Message",<<%dlg%
                            {nocaption}{background=yellow}
                            {region}
                            Kasa se�in...
                            {endregion};
                            %dlg%)
                            xbasic_wait_for_idle()
                            sleep(1)
                            ui_modeless_dlg_close("Message")
                            ui_dlg_ctl_goto("Sisteme giriş","prm_kasa")
                            a_dlg_button=""

                            else
                            ui_msg_box("KOntrol edilmeyen event",a_dlg_button)
                            end
                            end if
                            else if a_dlg_button="CANCEL"
                            IF IS_OBJECT("MESSAGE")
                            ui_modeless_dlg_close("Message")
                            END IF
                            end
                            end if
                            a_dlg_button=""
                            %code%)




                            dim tbl as P
                            tbl = table.open("klnc",FILE_RO_SHARED)
                            tbl.fetch_first()
                            while .not. tbl.fetch_eof()
                            if tbl.kullanici = prm_kullanici then
                            prm_sube = tbl.sube
                            prm_kasa = tbl.kasa
                            end if
                            tbl.fetch_next()
                            wend

                            if varC_result = "ok" then
                            ui_msg_box("","Şube: "+prm_sube +crlf() + "Kasa: "+prm_kasa)
                            else
                            ' a5.Close()
                            end if




                            ' Kullanıcı| [%k=klnc,{keylist_build('1:25', kullanici, kullanici)}%25prm_kullanici!kul_*];
                            ' Kullanıcı| [.25prm_kullanici^+vKullanici!kul_*];


                            'Table klnc

                            'Kullanici Character 20 0
                            'Parola Character 20 0
                            'Sube Character 20 0
                            'Kasa Character 20 0

                            ' Rows
                            'KULLANICI PAROLA SUBE KASA
                            'CEM PP
                            'OZGUR P0
                            'LEVENT P1 MERKEZ M.KASA
                            'ILBAY P2 KEMERALTI K.KASA
                            'UMIT P3 CANKAYA C.KASA
                            'CETIN P4 MERKEZ M.KASA
                            Ozgur Ugur
                            Computer Eng.
                            Data Yazilim Ltd.
                            Izmir - Turkiye

                            Comment


                              #29
                              Re: No xdialog killfocus event for combo box

                              can you please try to simplify your example and also describe the steps to take to duplicate and recognize the issue.

                              Comment


                                #30
                                Re: No xdialog killfocus event for combo box

                                Ok, here is a simplified and translated code.
                                Just select a user and press TAB or click mouse to move to another field. This should fire the kill_focus event, shouldn't it?
                                You need to create the table to duplicate because the code works fine with arrays.


                                DIM global prm_user as C
                                DIM global prm_dept as C
                                DIM global prm_floor as C
                                DIM SHARED varC_result as C

                                varC_result = ui_dlg_box("Login",<<%dlg%
                                {region}
                                User| [%k=klnc,{keylist_build('1:25', kullanici, kullanici)}%25prm_user!usr_*];
                                Department| [.25prm_dept!dep_*];
                                Fl_name| [.25prm_prm_floor!fln_*];
                                {endregion};

                                {line=1,0};

                                {region}
                                <Ok> <Cancel>
                                {endregion};
                                %dlg%,<<%code%
                                if a_dlg_button = "usr_killfocus"
                                if prm_user=""
                                ui_modeless_dlg_box("Message",<<%dlg%
                                {nocaption}{background=yellow}
                                {region}
                                Select user...
                                {endregion};
                                %dlg%)
                                xbasic_wait_for_idle()
                                sleep(1)
                                ui_modeless_dlg_close("Message")
                                ui_dlg_ctl_goto("Login","prm_user")
                                a_dlg_button=""
                                end if
                                else if a_dlg_button= "OK"
                                ui_msg_box("Ok","OK pressed")
                                else if a_dlg_button="CANCEL"
                                end
                                end if
                                a_dlg_button=""
                                %code%)
                                Ozgur Ugur
                                Computer Eng.
                                Data Yazilim Ltd.
                                Izmir - Turkiye

                                Comment

                                Working...
                                X