Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PG_ATTR_AUTOCOMPLETE isn't case sensitive #2667

Open
AlessandroMattiazzi opened this issue Jan 9, 2025 · 1 comment
Open

PG_ATTR_AUTOCOMPLETE isn't case sensitive #2667

AlessandroMattiazzi opened this issue Jan 9, 2025 · 1 comment
Labels
wxWidgets-tracked wxWidgets defect with associated ticket

Comments

@AlessandroMattiazzi
Copy link
Contributor

The flag PG_ATTR_AUTOCOMPLETE gives a list of options based on the input characters but the selection is not case sensitive. The real problem is that when a suggestion appear in the text_ctrl and we press enter, the suggestion doesn't replace the previous characters

image

And after pressing Enter

image

import wx
import wx.propgrid as wxpg

class MyFrame(wx.Frame):
    def __init__(self):
        super().__init__(None, title="wxPropertyGrid Autocomplete Example", size=(400, 300))

        string_property = wxpg.StringProperty("Autocomplete Property", value="")
        
        self.pg = wxpg.PropertyGrid(self, style=wxpg.PG_SPLITTER_AUTO_CENTER)
        self.pg.SetPropertyAttribute(string_property, wxpg.PG_ATTR_AUTOCOMPLETE, ["OPTION1", "OPTION2", "OPTION3"])
        self.pg.Append(string_property)
        
        sizer = wx.BoxSizer(wx.VERTICAL)
        sizer.Add(self.pg, 1, wx.EXPAND)
        self.SetSizer(sizer)

class MyApp(wx.App):
    def OnInit(self):
        frame = MyFrame()
        frame.Show()
        return True

if __name__ == "__main__":
    app = MyApp()
    app.MainLoop()
@swt2c
Copy link
Collaborator

swt2c commented Jan 9, 2025

This behavior is coming from upstream wxWidgets, so if you'd like to propose a change in behavior, you'll have to take it upstream.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wxWidgets-tracked wxWidgets defect with associated ticket
Projects
None yet
Development

No branches or pull requests

2 participants