~ubuntu-branches/ubuntu/trusty/ginkgocadx/trusty

« back to all changes in this revision

Viewing changes to src/cadxcore/wx/treelistctrl/treelistctrl.cpp

  • Committer: Package Import Robot
  • Author(s): Dmitry Smirnov
  • Date: 2013-07-21 11:58:53 UTC
  • mfrom: (7.2.1 sid)
  • Revision ID: package-import@ubuntu.com-20130721115853-44e7n1xujqglu78e
Tags: 3.4.0.928.29+dfsg-1
* New upstream release [July 2013]
  + new B-D: "libjsoncpp-dev".
  + new patch "unbundle-libjsoncpp.patch" to avoid building bundled
    "libjsoncpp-dev".
  + new patch "fix-wx.patch" to avoid FTBFS due to missing
    "-lwx_gtk2u_html-2.8".
* Removed unnecessary versioned Build-Depends.
* Removed obsolete lintian override.
* Reference get-orig-source implementation for orig.tar clean-up and
  DFSG-repackaging.
* Upload to unstable.

Show diffs side-by-side

added added

removed removed

Lines of Context:
905
905
    void SetImage (int column, int image, wxTreeItemIcon which)
906
906
    {
907
907
        // main column is special, more images available
908
 
        if (column == m_owner->GetMainColumn()) m_images[which] = image;
 
908
        if (column == m_owner->GetMainColumn()) {
 
909
                        if (which == wxTreeItemIcon_Max) {
 
910
                                //scecial... implies change all icons...
 
911
                                for (int i = 0; i < wxTreeItemIcon_Max; ++i) {
 
912
                                        m_images[i] = image;
 
913
                                }
 
914
                        } else {
 
915
                                m_images[which] = image;
 
916
                        }
909
917
        // other columns ignore the 'which' parameter
910
 
        else {
 
918
                } else {
911
919
            wxTreeListItemCellAttrHash::const_iterator entry = m_props_cell.find( column );
912
920
            if (entry == m_props_cell.end()) {
913
921
                m_props_cell[column] = new wxTreeListItemCellAttr();
3834
3842
        }break;
3835
3843
 
3836
3844
        // <RETURN>: activate current item
3837
 
        case WXK_RETURN: {
 
3845
        case WXK_RETURN:
 
3846
                case WXK_NUMPAD_ENTER:{
3838
3847
            if (! SendEvent(wxEVT_COMMAND_TREE_ITEM_ACTIVATED, m_curItem)) {
3839
3848
 
3840
3849
                // if the user code didn't process the activate event,
3853
3862
        }break;
3854
3863
 
3855
3864
        // <HOME>: go to first visible
3856
 
        case WXK_HOME: {
 
3865
        case WXK_HOME: 
 
3866
                case WXK_NUMPAD_HOME:
 
3867
                {
3857
3868
            newItem = GetFirstVisible(false, false);
3858
3869
        }break;
3859
3870
 
3860
3871
        // <PAGE-UP>: go to the top of the page, or if we already are then one page back
3861
 
        case WXK_PAGEUP: {
3862
 
        int flags = 0;
3863
 
        int col = 0;
3864
 
        wxPoint abs_p = CalcUnscrolledPosition (wxPoint(1,1));
 
3872
        case WXK_PAGEUP:
 
3873
                case WXK_NUMPAD_PAGEUP:
 
3874
                {
 
3875
                        int flags = 0;
 
3876
                        int col = 0;
 
3877
                        wxPoint abs_p = CalcUnscrolledPosition (wxPoint(1,1));
3865
3878
        // PAGE-UP: first go the the first visible row
3866
3879
            newItem = m_rootItem->HitTest(abs_p, this, flags, col, 0);
3867
3880
            newItem = GetFirstVisible(false, true);
3875
3888
        } break;
3876
3889
 
3877
3890
        // <UP>: go to the previous sibling or for the last of its children, to the parent
3878
 
        case WXK_UP: {
 
3891
        case WXK_UP:
 
3892
                case WXK_NUMPAD_UP:
 
3893
                        {
3879
3894
            newItem = GetPrevSibling (m_curItem);
3880
3895
            if (newItem) {
3881
3896
#if !wxCHECK_VERSION(2, 5, 0)
3895
3910
        }break;
3896
3911
 
3897
3912
        // <LEFT>: if expanded collapse subtree, else go to the parent
3898
 
        case WXK_LEFT: {
 
3913
                case WXK_LEFT:
 
3914
                case WXK_NUMPAD_LEFT: 
 
3915
                {
3899
3916
            if (IsExpanded (m_curItem)) {
3900
3917
                Collapse (m_curItem);
3901
3918
            }else{
3907
3924
        }break;
3908
3925
 
3909
3926
        // <RIGHT>: if possible expand subtree, else go go to the first child
3910
 
        case WXK_RIGHT: {
 
3927
        case WXK_RIGHT:
 
3928
                case WXK_NUMPAD_RIGHT:
 
3929
                {
3911
3930
            if (m_curItem->HasPlus() && !IsExpanded (m_curItem)) {
3912
3931
                Expand (m_curItem);
3913
3932
            }else{
3923
3942
        }break;
3924
3943
 
3925
3944
        // <DOWN>: if expanded go to the first child, else to the next sibling, ect
3926
 
        case WXK_DOWN: {
 
3945
        case WXK_DOWN:
 
3946
                case WXK_NUMPAD_DOWN:
 
3947
                {
3927
3948
            if (IsExpanded (m_curItem) && HasChildren (m_curItem)) {
3928
3949
#if !wxCHECK_VERSION(2, 5, 0)
3929
3950
                long cookie = 0;
3942
3963
        }break;
3943
3964
 
3944
3965
        // <PAGE-DOWN>: go to the bottom of the page, or if we already are then one page further
3945
 
        case WXK_PAGEDOWN: {
 
3966
                case WXK_PAGEDOWN:
 
3967
                case WXK_NUMPAD_PAGEDOWN: 
 
3968
                {
3946
3969
        int flags = 0;
3947
3970
        int col = 0;
3948
3971
        wxPoint abs_p = CalcUnscrolledPosition (wxPoint(1,GetClientSize().GetHeight() - m_curItem->GetHeight()));
3960
3983
        } break;
3961
3984
 
3962
3985
        // <END>: go to last item of the root
3963
 
        case WXK_END: {
 
3986
        case WXK_END: 
 
3987
                case WXK_NUMPAD_END:
 
3988
                {
3964
3989
            newItem = GetLastVisible (false, false);
3965
3990
        }break;
3966
3991