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

The python code was added with weird extras #732

Open
ChunJiu2008 opened this issue Apr 2, 2022 · 1 comment
Open

The python code was added with weird extras #732

ChunJiu2008 opened this issue Apr 2, 2022 · 1 comment

Comments

@ChunJiu2008
Copy link

When I fill in the arithmetic expression in the id of wxWindow, the generated python code is prepended with some strange content, which of course is incorrect content.

Example : Fill in the id field with wxID_HIGHEST + 22000 + 1 etc.

The wrong code looks like this:

# -*- coding: utf-8 -*-

###########################################################################
## Python code generated with wxFormBuilder (version 3.10.1-0-g8feb16b3)
## http://www.wxformbuilder.org/
##
## PLEASE DO *NOT* EDIT THIS FILE!
###########################################################################

import wx
import wx.xrc

wx.ID_HIGHEST + 22000 = 1000        # <---------- These are incorrect
wx.ID_HIGHEST + 22000 + 1 = 1001    # <---------- These are incorrect
wx.ID_HIGHEST + 22000 + 2 = 1002    # <---------- These are incorrect
wx.ID_HIGHEST + 22000 + 3 = 1003    # <---------- These are incorrect

###########################################################################
## Class cpl_tool_status
###########################################################################

class cpl_tool_status ( wx.Panel ):
@sodevel
Copy link
Member

sodevel commented Apr 4, 2022

There is no expression parser inside wxFormBuilder, values are usually used as-is. In these days you should not use static ids for your widgets anymore (except stock ids), just use dynamically created ids by wxID_ANY. If you want to modify the starting value of custom static ids, use the project property first_id.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants