Module: Wx::ArtLocator
- Defined in:
- lib/wx/doc/art_locator.rb
Constant Summary collapse
- ART_FOLDER =
Default name of art folder.
'art'
Class Method Summary collapse
-
.add_search_path(*names) ⇒ Object
(also: add_search_paths)
Adds one or more search paths to look for art files.
-
.art_folder ⇒ String
Returns the base name for the folder holding application art files.
-
.art_folder=(name) ⇒ Object
Sets the base name for the folder holding application art files.
-
.find_art(art_name, art_type: nil, art_path: nil, art_section: nil, bmp_type: nil) ⇒ String?
Searches for the an art file for the given ‘art_name’.
Class Method Details
.add_search_path(*names) ⇒ Object Also known as: add_search_paths
Adds one or more search paths to look for art files. By default ArtLocator#find_art will look only at locations of the caller’s file path. If search paths have been added though these will be searched after the lookup in the caller’s path has failed.
34 |
# File 'lib/wx/doc/art_locator.rb', line 34 def add_search_path(*names) end |
.art_folder ⇒ String
Returns the base name for the folder holding application art files. By default this returns ART_FOLDER
24 |
# File 'lib/wx/doc/art_locator.rb', line 24 def art_folder; end |
.art_folder=(name) ⇒ Object
Sets the base name for the folder holding application art files.
28 |
# File 'lib/wx/doc/art_locator.rb', line 28 def art_folder=(name) end |
.find_art(art_name, art_type: nil, art_path: nil, art_section: nil, bmp_type: nil) ⇒ String?
Searches for the an art file for the given ‘art_name’. By default the search will be performed at the following locations (in order): 1. <art_path>/<#art_folder>/<art_section>/<art_type>/ 2. <art_path>/<#art_folder>/<art_section>/ 3. <art_path>/<#art_folder>/ 4. <art_path>/ Where ‘art_type’ is any of :icon
, :bitmap
, :cursor
, :image
or nil
. If ‘art_type’ is nil the first location will be skipped. In case ‘art_path’ == nil
the absolute path to the folder holding the caller’s code will be used which is determined through ::Kernel#caller_locations. If ‘art_section’ is also nil
the basename of the caller’s source file will be used. At each location the existence of a file with base name ‘art_name’ and each of the supported extensions for the given ‘art_type’ (see wxWidgets documentation) will be tested. If ‘art_type’ is nil all extensions for all supported bitmap types will be tested (similar to when ‘art_type’ is :image). If an optional Wx::BitmapType is specified through ‘bmp_type’ the tested extensions will be restricted to the extensions supported for specified the bitmap type.
In case additional search paths have been specified through #add_search_path these will be searched after the lookup at ‘art_path’ fails. For each search path the same lookups will be performed (replacing ‘art_path’ by the search path).
63 |
# File 'lib/wx/doc/art_locator.rb', line 63 def find_art(art_name, art_type: nil, art_path: nil, art_section: nil, bmp_type: nil) end |