Set OK button permanently OK bypassing the dialogue

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

Set OK button permanently OK bypassing the dialogue

d chung

I am the programmer with a learner plate. There is a dialogue in the same wxpython programme which I posted on 28 Apr. By calling the dialogue, the original design allows:

         the price and quantity be changed by the cashier,

         the system would check 2 dictionaries for duplicates and adjust the prices and quantity.


Is it possible to set LN 15 OK button to OK permanently? There will be no need for human intervention for each input. To dismantle the dialogue would need a lot of programming beyond my capability now.TKS

--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/wxpython-users/b9cf7601-3729-4c19-8362-6847bf2c7bcf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

onselect.py (3K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Set OK button permanently OK bypassing the dialogue

Robin Dunn
On Thursday, May 30, 2019 at 2:01:31 AM UTC-7, d chung wrote:

I am the programmer with a learner plate. There is a dialogue in the same wxpython programme which I posted on 28 Apr. By calling the dialogue, the original design allows:

         the price and quantity be changed by the cashier,

         the system would check 2 dictionaries for duplicates and adjust the prices and quantity.


Is it possible to set LN 15 OK button to OK permanently? There will be no need for human intervention for each input. To dismantle the dialogue would need a lot of programming beyond my capability now.TKS


I'm not sure I understand "set LN 15 OK button to OK permanently". Does that mean that you want to display the dialog and then have it exit immediately with an OK status as if the OK button was clicked? That seems fairly terrible from a UX perspective, but if you really want to go that way then the dialog code could do it by calling `self.EndModal(wx.ID_OK)` when it decides it's ready to exit.

--
Robin

--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/wxpython-users/7a397713-2597-469a-a5bc-74b178ed6aa8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Set OK button permanently OK bypassing the dialogue

d chung
In reply to this post by d chung
Dear masters,
I am moving on.
I cut away the dlg part and replaced it with some fixed values.
Everything works fine except that the bar code has been read 248 times and there is no loop in the codes. It was entered only once. What went wrong?

Chung 


On Thursday, 30 May 2019 17:01:31 UTC+8, d chung wrote:

I am the programmer with a learner plate. There is a dialogue in the same wxpython programme which I posted on 28 Apr. By calling the dialogue, the original design allows:

         the price and quantity be changed by the cashier,

         the system would check 2 dictionaries for duplicates and adjust the prices and quantity.


Is it possible to set LN 15 OK button to OK permanently? There will be no need for human intervention for each input. To dismantle the dialogue would need a lot of programming beyond my capability now.TKS

--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/wxpython-users/d5d33069-b9cf-4569-ad4f-e81c16a6ab20%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Set OK button permanently OK bypassing the dialogue

Tim Roberts
On Jun 22, 2019, at 2:23 AM, d chung <[hidden email]> wrote:

I cut away the dlg part and replaced it with some fixed values.
Everything works fine except that the bar code has been read 248 times and there is no loop in the codes. It was entered only once. What went wrong?

You haven't shown us anything about a bar code, so we can't possibly address that.  You did

I do want to point out that this line will never succeed:

            if self.input[2] != 0 and not self.input[2]:

That says "if input 2 is not 0 and input 2 is 0."  It can never be both.  I can't guess what you really intended there.

I'm also concerned about these linesL
                self.m1, self.t1 = '', ''
                self.Language()
                wx.MessageBox(self.m1, self.t1)

Is the "self.Language()" call going to modify the values of self.m1 and self.t1?  If so, that's a very poor design, because you're relying on side effects.  A person looking at your code would have no way to know that the function call is modifying other variables.  If that's looking up a language translation, it would be much better to pass them as parameters:
                m1, t1 = self.Language( '', '' )

Now it's absolutely clear what goes in, and what comes out.
— 
Tim Roberts, [hidden email]
Providenza & Boekelheide, Inc.

--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/wxpython-users/A30E7399-30B0-4FB0-B0D8-15C30F48690C%40probo.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Set OK button permanently OK bypassing the dialogue

d chung
In reply to this post by d chung

Dear Tim,


I pirated a kind-hearted man’s open-source programme for my own use.

The bar code is entered here.

Line 229 self.search_text = (self.search_bar.GetValue()).split()


The original design was bring up a dialogue. All data would be stored in self.input [ ]. I deleted the dialogue.


Line 258 self.input = [self.selected_info[0],self.selected_info[1],self.selected_info[3],'1']

The barcode has been read 248 times or more although it was entered once.
TKS
Dom

On Thursday, 30 May 2019 17:01:31 UTC+8, d chung wrote:

I am the programmer with a learner plate. There is a dialogue in the same wxpython programme which I posted on 28 Apr. By calling the dialogue, the original design allows:

         the price and quantity be changed by the cashier,

         the system would check 2 dictionaries for duplicates and adjust the prices and quantity.


Is it possible to set LN 15 OK button to OK permanently? There will be no need for human intervention for each input. To dismantle the dialogue would need a lot of programming beyond my capability now.TKS

--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/wxpython-users/22dcde65-a009-4fee-b6ba-d5cc32132fe7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

pnl_pos.py (26K) Download Attachment
posdup.jpg (3M) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Set OK button permanently OK bypassing the dialogue

Karsten Hilbert
On Wed, Jun 26, 2019 at 09:00:56PM -0700, d chung wrote:

> I pirated a kind-hearted man’s open-source programme for my own use.
>
> The bar code is entered here.
>
> Line 229 self.search_text = (self.search_bar.GetValue()).split()
>
>
> The original design was bring up a dialogue. All data would be stored in
> self.input [ ]. I deleted the dialogue.
>
>
> Line 258 self.input =
> [self.selected_info[0],self.selected_info[1],self.selected_info[3],'1']
> The barcode has been read 248 times or more although it was entered once.

Given that description I would look for code which receives a
string from the barcode reader and then erroneously loops
over each of the characters in the string rather than
treating it as a whole.

Since you

> I deleted the dialogue.

you need to be 100% sure what the program logic is.

Karsten
--
GPG  40BE 5B0E C98E 1713 AFA6  5BC0 3BEA AC80 7D4F C89B

--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/wxpython-users/20190627072122.GA3188%40hermes.hilbert.loc.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Set OK button permanently OK bypassing the dialogue

d chung
Dear Karsten,
Thank you.
I have worked on the wxpython programme for 4 months and understood
the logic very well.The barcode entry and everything was working fine.
I only had the courage to cut away the dlg last week without changing
anything.
regards,
Dom

On 6/27/19, Karsten Hilbert <[hidden email]> wrote:

> On Wed, Jun 26, 2019 at 09:00:56PM -0700, d chung wrote:
>
>> I pirated a kind-hearted man’s open-source programme for my own use.
>>
>> The bar code is entered here.
>>
>> Line 229 self.search_text = (self.search_bar.GetValue()).split()
>>
>>
>> The original design was bring up a dialogue. All data would be stored in
>> self.input [ ]. I deleted the dialogue.
>>
>>
>> Line 258 self.input =
>> [self.selected_info[0],self.selected_info[1],self.selected_info[3],'1']
>> The barcode has been read 248 times or more although it was entered once.
>
> Given that description I would look for code which receives a
> string from the barcode reader and then erroneously loops
> over each of the characters in the string rather than
> treating it as a whole.
>
> Since you
>
>> I deleted the dialogue.
>
> you need to be 100% sure what the program logic is.
>
> Karsten
> --
> GPG  40BE 5B0E C98E 1713 AFA6  5BC0 3BEA AC80 7D4F C89B
>
> --
> You received this message because you are subscribed to the Google Groups
> "wxPython-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [hidden email].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/wxpython-users/20190627072122.GA3188%40hermes.hilbert.loc.
> For more options, visit https://groups.google.com/d/optout.
>

--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/wxpython-users/CAOz8UQY2FtSfemMLr-J_zd38nBjPYqAkyHZpxTgK4Q5JzkGMsw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Set OK button permanently OK bypassing the dialogue

Tim Roberts
In reply to this post by d chung
On Jun 26, 2019, at 9:00 PM, d chung <[hidden email]> wrote:

The bar code is entered here.

Line 229 self.search_text = (self.search_bar.GetValue()).split()

..

Line 258 self.input = [self.selected_info[0],self.selected_info[1],self.selected_info[3],'1']

The barcode has been read 248 times or more although it was entered once.

Of course, because this is in self.OnSearch, which is bound to the wx.EVT_TEXT event.  EVT_TEXT is fired every time the textbox changes.  If the bar code reader enters 248 characters, the textbox will change 248 times, and the event will be fired 248 times.  If you type "12345", you'll get an EVT_TEXT for "1", and then for "12", and then for "123", and then for "1234", and then for "12345".

Does the barcode reader have any special character at the end of the string?  Or, do you know how long the string is supposed to be?  You can just call evt.Skip and return if self.search_bar.GetValue() is not long enough, or does not have the proper ending character. 
— 
Tim Roberts, [hidden email]
Providenza & Boekelheide, Inc.

--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/wxpython-users/5DEC9E13-7812-4258-A368-5C8A7D222024%40probo.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Set OK button permanently OK bypassing the dialogue

d chung
In reply to this post by d chung
Dear masters,
The original design for the search was to look for anything. There was a split( ). I fixed the input to only bar code. The whole world collapsed with the bar code truncated Thank you guys.


On Thursday, 30 May 2019 17:01:31 UTC+8, d chung wrote:

I am the programmer with a learner plate. There is a dialogue in the same wxpython programme which I posted on 28 Apr. By calling the dialogue, the original design allows:

         the price and quantity be changed by the cashier,

         the system would check 2 dictionaries for duplicates and adjust the prices and quantity.


Is it possible to set LN 15 OK button to OK permanently? There will be no need for human intervention for each input. To dismantle the dialogue would need a lot of programming beyond my capability now.TKS

--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/wxpython-users/2db32fb2-c966-46f8-a6a1-79b758455841%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.