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

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_folderString

Returns the base name for the folder holding application art files. By default this returns ART_FOLDER

Returns:

  • (String)


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.

Parameters:

  • name (String)

    art folder base name



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).

Parameters:

  • art_name (String, Symbol)

    base name for art file

  • art_type (Symbol, nil) (defaults to: nil)

    type of art to look for (:icon, :bitmap, :cursor, :image)

  • art_path (String, nil) (defaults to: nil)

    base path to look up the art file

  • art_section (String, nil) (defaults to: nil)

    optional owner folder name for art files

  • bmp_type (Wx::BitmapType, nil) (defaults to: nil)

    bitmap type of art file

Returns:

  • (String, nil)

    full path of art file or nil if not found



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