1 |
jonathan |
648 |
# Copyright (c) 2003 by Intevation GmbH |
2 |
|
|
# Authors: |
3 |
|
|
# Jonathan Coles <[email protected]> |
4 |
|
|
# |
5 |
|
|
# This program is free software under the GPL (>=v2) |
6 |
|
|
# Read the file COPYING coming with Thuban for details. |
7 |
|
|
|
8 |
bh |
1542 |
"""Acess to UI-related resources""" |
9 |
|
|
|
10 |
|
|
__version__ = "$Revision$" |
11 |
|
|
# $Source$ |
12 |
|
|
# $Id$ |
13 |
|
|
|
14 |
|
|
|
15 |
jonathan |
648 |
import os |
16 |
|
|
import Thuban |
17 |
|
|
|
18 |
jonathan |
1303 |
from wxPython.wx import wxBITMAP_TYPE_XPM, wxBITMAP_TYPE_ANY, wxBitmap, wxImage |
19 |
jonathan |
648 |
|
20 |
|
|
|
21 |
|
|
bitmapdir = os.path.join(Thuban.__path__[0], os.pardir, "Resources", "Bitmaps") |
22 |
jonathan |
1303 |
bitmap_extensions = {wxBITMAP_TYPE_XPM: ".xpm", |
23 |
|
|
wxBITMAP_TYPE_ANY: ""} |
24 |
bh |
1542 |
|
25 |
jonathan |
648 |
def GetBitmapResource(file, type): |
26 |
jonathan |
1303 |
filename = os.path.join(bitmapdir, file) + bitmap_extensions[type] |
27 |
jonathan |
648 |
return wxBitmap(filename, type) |
28 |
|
|
|
29 |
jonathan |
1303 |
def GetImageResource(file, type): |
30 |
|
|
filename = os.path.join(bitmapdir, file) + bitmap_extensions[type] |
31 |
|
|
return wxImage(filename, type) |
32 |
|
|
|