Skip to content

Commit

Permalink
use correct constant names (snake-case uppercased) and also include i…
Browse files Browse the repository at this point in the history
…n library
  • Loading branch information
mcorino committed Oct 23, 2023
1 parent c5050d8 commit f75ef27
Show file tree
Hide file tree
Showing 2 changed files with 149 additions and 66 deletions.
83 changes: 83 additions & 0 deletions lib/wx/core/const.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
# Copyright (c) 2023 M.J.N. Corino, The Netherlands
#
# This software is released under the MIT license.


module Wx

=begin
These constants are not documented in the wxWidgets interface headers
although they are referenced in various argument defaults which *are*
in the interface header declarations so.
=end

DEFAULT_DATE_TIME_FORMAT = '%c'
DEFAULT_TIME_SPAN_FORMAT = '%H:%M:%S'

CHOICE_NAME_STR = 'choice'
COLOUR_PICKER_CTRL_NAME_STR = 'colourpicker'
COLOUR_PICKER_WIDGET_NAME_STR = 'colourpickerwidget'
HYPERLINK_CTRL_NAME_STR = 'hyperlink'
PANEL_NAME_STR = 'panel'
LIST_BOX_NAME_STR = 'listBox'
FRAME_NAME_STR = 'frame'
STATUS_LINE_NAME_STR = 'status_line'
STATIC_BITMAP_NAME_STR = 'staticBitmap'
WEB_VIEW_NAME_STR = 'wxWebView'
ANIMATION_CTRL_NAME_STR = 'animationctrl'
TOOL_BAR_NAME_STR = 'toolbar'
TEXT_CTRL_NAME_STR = 'text'
LIST_CTRL_NAME_STR = 'listCtrl'
FILE_PICKER_CTRL_NAME_STR = 'filepicker'
FILE_PICKER_WIDGET_NAME_STR = 'filepickerwidget'
DIR_PICKER_CTRL_NAME_STR = 'dirpicker'
DIR_PICKER_WIDGET_NAME_STR = 'dirpickerwidget'
FILE_CTRL_NAME_STR = 'wxfilectrl'
FILE_SELECTOR_PROMPT_STR = 'Select a file'
STATIC_BOX_NAME_STR = 'groupBox'
BUTTON_NAME_STR = 'button'
RADIO_BOX_NAME_STR = 'radioBox'
STATIC_LINE_NAME_STR = 'staticLine'
RADIO_BUTTON_NAME_STR = 'radioButton'
BITMAP_RADIO_BUTTON_NAME_STR = 'radioButton'
GAUGE_NAME_STR = 'gauge'
DATA_VIEW_CTRL_NAME_STR = 'dataviewCtrl'
FONT_PICKER_CTRL_NAME_STR = 'fontpicker'
FONT_PICKER_WIDGET_NAME_STR = 'fontpickerwidget'
REARRANGE_LIST_NAME_STR = 'wxRearrangeList'
REARRANGE_DIALOG_NAME_STR = 'wxRearrangeDlg'
NOTEBOOK_NAME_STR = 'notebook'
CONTROL_NAME_STR = 'control'
SCROLL_BAR_NAME_STR = 'scrollBar'
STATUS_BAR_NAME_STR = 'statusBar'
SLIDER_NAME_STR = 'slider'
HEADER_CTRL_NAME_STR = 'wxHeaderCtrl'
BITMAP_COMBO_BOX_NAME_STR = 'bitmapComboBox'
CHECK_BOX_NAME_STR = 'check'
FILE_DIALOG_NAME_STR = 'filedlg'
ADD_REMOVE_CTRL_NAME_STR = 'wxAddRemoveCtrl'
STATIC_TEXT_NAME_STR = 'staticText'
COMBO_BOX_NAME_STR = 'comboBox'
SEARCH_CTRL_NAME_STR = 'searchCtrl'
TREE_CTRL_NAME_STR = 'treeCtrl'
DIALOG_NAME_STR = 'dialog'
COLLAPSIBLE_HEADER_CTRL_NAME_STR = 'collapsibleHeader'
COLLAPSIBLE_PANE_NAME_STR = 'collapsiblePane'
BANNER_WINDOW_NAME_STR = 'bannerwindow'
GRID_NAME_STR = 'grid'
TREE_LIST_CTRL_NAME_STR = 'wxTreeListCtrl'
HTML_LIST_BOX_NAME_STR = 'htmlListBox'
SIMPLE_HTML_LIST_BOX_NAME_STR = 'simpleHtmlListBox'
EDITABLE_LIST_BOX_NAME_STR = 'editableListBox'
V_LIST_BOX_NAME_STR = 'wxVListBox'

if Wx::PLATFORM == 'WXMSW'
# wxMSW only
MSW_HEADER_CTRL_NAME_STR = 'wxMSWHeaderCtrl'
end

PROPERTY_GRID_MANAGER_NAME_STR = 'wxPropertyGridManager'
PROPERTY_GRID_NAME_STR = 'wxPropertyGrid'
STC_NAME_STR = 'stcwindow'

end
132 changes: 66 additions & 66 deletions lib/wx/doc/const.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,74 +11,74 @@ module Wx
These constants are not documented in the wxWidgets interface headers
although they are referenced in various argument defaults which *are*
in the interface header declarations so we do want them included the
wxRuby docs so the doc links work but we do not need them in the
wxRuby implementation since these are internal to the C++ wrappers.
wxRuby docs so the doc links work.
=end

DefaultDateTimeFormat = '%c'
DefaultTimeSpanFormat = '%H:%M:%S'
DEFAULT_DATE_TIME_FORMAT = '%c'
DEFAULT_TIME_SPAN_FORMAT = '%H:%M:%S'

ChoiceNameStr = 'choice'
ColourPickerCtrlNameStr = 'colourpicker'
ColourPickerWidgetNameStr = 'colourpickerwidget'
HyperlinkCtrlNameStr = 'hyperlink'
PanelNameStr = 'panel'
ListBoxNameStr = 'listBox'
FrameNameStr = 'frame'
StatusLineNameStr = 'status_line'
StaticBitmapNameStr = 'staticBitmap'
WebViewNameStr = 'wxWebView'
AnimationCtrlNameStr = 'animationctrl'
ToolBarNameStr = 'toolbar'
TextCtrlNameStr = 'text'
ListCtrlNameStr = 'listCtrl'
FilePickerCtrlNameStr = 'filepicker'
FilePickerWidgetNameStr = 'filepickerwidget'
DirPickerCtrlNameStr = 'dirpicker'
DirPickerWidgetNameStr = 'dirpickerwidget'
FileCtrlNameStr = 'wxfilectrl'
StaticBoxNameStr = 'groupBox'
ButtonNameStr = 'button'
RadioBoxNameStr = 'radioBox'
StaticLineNameStr = 'staticLine'
RadioButtonNameStr = 'radioButton'
BitmapRadioButtonNameStr = 'radioButton'
GaugeNameStr = 'gauge'
DataViewCtrlNameStr = 'dataviewCtrl'
FontPickerCtrlNameStr = 'fontpicker'
FontPickerWidgetNameStr = 'fontpickerwidget'
RearrangeListNameStr = 'wxRearrangeList'
RearrangeDialogNameStr = 'wxRearrangeDlg'
NotebookNameStr = 'notebook'
ControlNameStr = 'control'
ScrollBarNameStr = 'scrollBar'
StatusBarNameStr = 'statusBar'
SliderNameStr = 'slider'
HeaderCtrlNameStr = 'wxHeaderCtrl'
BitmapComboBoxNameStr = 'bitmapComboBox'
CheckBoxNameStr = 'check'
FileDialogNameStr = 'filedlg'
AddRemoveCtrlNameStr = 'wxAddRemoveCtrl'
StaticTextNameStr = 'staticText'
ComboBoxNameStr = 'comboBox'
SearchCtrlNameStr = 'searchCtrl'
DirDialogNameStr = 'wxDirCtrl'
TreeCtrlNameStr = 'treeCtrl'
DialogNameStr = 'dialog'
CollapsibleHeaderCtrlNameStr = 'collapsibleHeader'
CollapsiblePaneNameStr = 'collapsiblePane'
BannerWindowNameStr = 'bannerwindow'
GridNameStr = 'grid'
TreeListCtrlNameStr = 'wxTreeListCtrl'
HtmlListBoxNameStr = 'htmlListBox'
SimpleHtmlListBoxNameStr = 'simpleHtmlListBox'
EditableListBoxNameStr = 'editableListBox'
VListBoxNameStr = 'wxVListBox'
CollapsiblePaneNameStr = 'collapsiblePane'
MSWHeaderCtrlNameStr = 'wxMSWHeaderCtrl'
PropertyGridManagerNameStr = 'wxPropertyGridManager'
PropertyGridNameStr = 'wxPropertyGrid'
STCNameStr = 'stcwindow'
STCNameStr = 'stcwindow'
CHOICE_NAME_STR = 'choice'
COLOUR_PICKER_CTRL_NAME_STR = 'colourpicker'
COLOUR_PICKER_WIDGET_NAME_STR = 'colourpickerwidget'
HYPERLINK_CTRL_NAME_STR = 'hyperlink'
PANEL_NAME_STR = 'panel'
LIST_BOX_NAME_STR = 'listBox'
FRAME_NAME_STR = 'frame'
STATUS_LINE_NAME_STR = 'status_line'
STATIC_BITMAP_NAME_STR = 'staticBitmap'
WEB_VIEW_NAME_STR = 'wxWebView'
ANIMATION_CTRL_NAME_STR = 'animationctrl'
TOOL_BAR_NAME_STR = 'toolbar'
TEXT_CTRL_NAME_STR = 'text'
LIST_CTRL_NAME_STR = 'listCtrl'
FILE_PICKER_CTRL_NAME_STR = 'filepicker'
FILE_PICKER_WIDGET_NAME_STR = 'filepickerwidget'
DIR_PICKER_CTRL_NAME_STR = 'dirpicker'
DIR_PICKER_WIDGET_NAME_STR = 'dirpickerwidget'
FILE_CTRL_NAME_STR = 'wxfilectrl'
FILE_SELECTOR_PROMPT_STR = 'Select a file'
STATIC_BOX_NAME_STR = 'groupBox'
BUTTON_NAME_STR = 'button'
RADIO_BOX_NAME_STR = 'radioBox'
STATIC_LINE_NAME_STR = 'staticLine'
RADIO_BUTTON_NAME_STR = 'radioButton'
BITMAP_RADIO_BUTTON_NAME_STR = 'radioButton'
GAUGE_NAME_STR = 'gauge'
DATA_VIEW_CTRL_NAME_STR = 'dataviewCtrl'
FONT_PICKER_CTRL_NAME_STR = 'fontpicker'
FONT_PICKER_WIDGET_NAME_STR = 'fontpickerwidget'
REARRANGE_LIST_NAME_STR = 'wxRearrangeList'
REARRANGE_DIALOG_NAME_STR = 'wxRearrangeDlg'
NOTEBOOK_NAME_STR = 'notebook'
CONTROL_NAME_STR = 'control'
SCROLL_BAR_NAME_STR = 'scrollBar'
STATUS_BAR_NAME_STR = 'statusBar'
SLIDER_NAME_STR = 'slider'
HEADER_CTRL_NAME_STR = 'wxHeaderCtrl'
BITMAP_COMBO_BOX_NAME_STR = 'bitmapComboBox'
CHECK_BOX_NAME_STR = 'check'
FILE_DIALOG_NAME_STR = 'filedlg'
ADD_REMOVE_CTRL_NAME_STR = 'wxAddRemoveCtrl'
STATIC_TEXT_NAME_STR = 'staticText'
COMBO_BOX_NAME_STR = 'comboBox'
SEARCH_CTRL_NAME_STR = 'searchCtrl'
TREE_CTRL_NAME_STR = 'treeCtrl'
DIALOG_NAME_STR = 'dialog'
COLLAPSIBLE_HEADER_CTRL_NAME_STR = 'collapsibleHeader'
COLLAPSIBLE_PANE_NAME_STR = 'collapsiblePane'
BANNER_WINDOW_NAME_STR = 'bannerwindow'
GRID_NAME_STR = 'grid'
TREE_LIST_CTRL_NAME_STR = 'wxTreeListCtrl'
HTML_LIST_BOX_NAME_STR = 'htmlListBox'
SIMPLE_HTML_LIST_BOX_NAME_STR = 'simpleHtmlListBox'
EDITABLE_LIST_BOX_NAME_STR = 'editableListBox'
V_LIST_BOX_NAME_STR = 'wxVListBox'

# wxMSW only
MSW_HEADER_CTRL_NAME_STR = 'wxMSWHeaderCtrl'

PROPERTY_GRID_MANAGER_NAME_STR = 'wxPropertyGridManager'
PROPERTY_GRID_NAME_STR = 'wxPropertyGrid'
STC_NAME_STR = 'stcwindow'

end

0 comments on commit f75ef27

Please sign in to comment.