Smallworld 5 Upgrade Information
Data Model Migrations
None for 4.3->5
According to GE no DM upgrades to their products are required when migrating from 4.3 to 5.0.
ICO -> PNG Conversion
ICO files are no longer supported for icons in Smallworld 5. I have noticed that using conversion programs such as IrfanView, the results are a very black icon. Mostly because the translucency hasn't been converted correctly.
The settings that seem to work best are setting the black as the transparent color, no PNG compression (0 in IrfvanView in file format options), and forcing the PNG icon to be 16 colors (in advanced bach options of IrfanView).
IcoFX (free) works better. They have a Tools->convert option. This will add size info to the PNG files. Also create multiple sizes if ico had that. IcoFX does a better job with color conversion.
CUR -> PNG Conversion
The converted PNG file must be have the dimensions and _cur appended to the file name. For example: dynamic.cur must be named dynamic_16_16_cur.png. This assume the size of the PNG is greater than 17x17 pixels and the "hotspot" or click action will take place at pixel 16,16.
The hotspot is defined by the ##, ## of the _##_##_cur appended name.
Application Look and Feel
Icons
Some people don't like look of the new icons in SW 5. Attached to this page is a zip file of the 4.3 ICO files converted to PNG.
Real Estate
The out of the box application has sacrificed work space for larger icon placements and taller tabs. As a puck monkey, I want the most map space available. There is a SWIFT theme mechanism that is not really documented that is available called sw_swift_manager. You can get & create sw_swift_theme that modify the application. Before you start saying (like I did) I need to modify the SWAF application… It appears SWV all GUI widgets are converted into SWIFT items. So SWIFT manager does affect SWAF applications… Below is some settings and tab container code that I found gives most usable space.
#t_theme << sw_swift_theme.available_themes[1] # you want to ensure :sw5 name
t_theme << sw_swift_manager.available_themes[1] # you want to ensure :sw5 name
t_theme.set_property(:button_top_spacing,0)
t_theme.set_property(:button_right_spacing,0)
t_theme.set_property(:button_bottom_spacing,2)
t_theme.set_property(:button_left_spacing,2)
t_theme.set_property(:default_item_spacing,1)
t_theme.set_property(:default_border_spacing,1)
t_theme.set_property(:default_outer_border_spacing,1)
t_theme.set_property(:default_indent_spacing,1)
f << font.new_with_properties(
:type, :logical, :name, "plain",
:point_size, 11,:device, :screen)
ts << text_style.new_with_properties(:font, f)
t_theme.set_property(:default_text_style,ts)
ts << text_style.new_with_properties(:font, f,
:colour,colour.called(:white))
t_theme.set_property(:current_tab_text_style,ts)
sw_swift_manager.set_current_theme(t_theme)
# for tab height
_pragma(classify_level=basic, topic={swift})
_method sw_tab_container.add_tab( a_container )
##
## Creates a new tab and page in the container.
## Adds A_CONTAINER to the tab.
## Returns the new page (a container to add the content to) and
## it's associated tab.
##
## Modifications : tightened the height of the tabs
#---------------- HISTORY ---------------------
# (2016/10/20 - Mark Field (FCSI)) : Modified - changed the height of the tabs
#----------------------------------------------
page << sw_container.new( .page_container, 1, 1 )
_if .show_border?
_then
page.outer_spacing << 5
_elif _self.get_background_colour().eq?( .page_colour )
_then
page.top_spacing << 3
_else
page.outer_spacing << 4
_endif
.page_container.get_data( :original_items ).add_last( page )
_if .current_index _is _unset
_then
.current_index << 1
_else
page.managed? << _false
_endif
# LINE CHANGE -- (2016/10/20 M Field (FCSI)) :
# Changed top/bottom spacing to 2
tab << sw_container.new( .tab_container, 1, 1,
:left_spacing, 7,
:right_spacing, 7,
:top_spacing, 2, #5,
:bottom_spacing, 2, #5,
:border_points_method, :rounded_rectangle_points_2|()|,
:identifier, :tab )
.tab_container.get_data( :original_items ).add_last( tab )
tab.allow_keyboard_navigation? << _true
.tab_group.add( tab )
_if .show_border?
_then
tab.pre_draw_handler << handler.new( _self, :draw_tab_with_border|()| )
_else
tab.pre_draw_handler << handler.new( _self, :draw_tab|()| )
_endif
e_handler << sw_event_handler.new()
e_handler.primary_release_handler << handler.new( _self, :tab_selected|()|, tab )
e_handler.key_press_handler << handler.new( _self, :handle_tab_key_event|()|, tab )
e_handler.focus_gained_handler << handler.new( _self, :handle_tab_focus_gained_event|()| )
e_handler.focus_lost_handler << handler.new( _self, :handle_tab_focus_lost_event|()| )
redraw_handler << handler.new( tab, :redraw|()| )
e_handler.enter_handler << redraw_handler
e_handler.exit_handler << redraw_handler
tab.add_event_handler( e_handler )
a_container.distribute_message( :|enable_background_copy?<<|, _false )
tab.add( a_container )
>> page, tab
_endmethod
$
Between the attached icons (PNGs) and the code, it gives about the same real estate as 4.3 applications did.
Panel Based GUIs
Older Panel based GUIs may have issues under SWV. The conversion from panel to SWIFT based rowcol (Yes in SWV everything is SIFT based, it translates older components to SWIFT components) is not always correct. The resizing especially is very hit or miss. The best thing I have seen is to convert your panels to row cols and define the sizes as much as possible. Letting it to automatically do that leads to issues.
Icons Directory
You can put the PNG icons (converted above) into the resources/icons directory. You can keep your original ICOs in bitmaps. This allows you to have v5 and v4 icons within one module.[1]
Bibliography
1. Christoph Decking