~ubuntu-branches/debian/squeeze/erlang/squeeze

« back to all changes in this revision

Viewing changes to lib/tv/src/tv_pb_funcs.erl

  • Committer: Bazaar Package Importer
  • Author(s): Erlang Packagers, Sergei Golovan
  • Date: 2006-12-03 17:07:44 UTC
  • mfrom: (2.1.11 feisty)
  • Revision ID: james.westby@ubuntu.com-20061203170744-rghjwupacqlzs6kv
Tags: 1:11.b.2-4
[ Sergei Golovan ]
Fixed erlang-base and erlang-base-hipe prerm scripts.

Show diffs side-by-side

added added

removed removed

Lines of Context:
223
223
                       col_mark_params = ColMarkP} = ProcVars,
224
224
    
225
225
    #col_mark_params{col_btn_id         = MarkedColBtnId,
226
 
                     sort_btn_id        = OldSortBtnId,
227
 
                     virtual_col_marked = ColMarked}  = ColMarkP,
 
226
                     sort_btn_id        = OldSortBtnId}  = ColMarkP,
228
227
    
229
228
       % Set the new color of the sort btn, and remove the mark, if it is the same
230
229
       % column!
331
330
 
332
331
unmark_sort_col(undefined, _ColMarked, _SortCol) ->
333
332
    done;
334
 
unmark_sort_col(SortBtnId, ColMarked, SortCol) ->
 
333
unmark_sort_col(SortBtnId, _ColMarked, _SortCol) ->
335
334
    gs:config(SortBtnId, [{bg, ?DEFAULT_BG_COLOR},
336
335
                          {fg, {0, 0, 0}}
337
336
                         ]).
353
352
%%======================================================================
354
353
 
355
354
 
356
 
mark_marked_col(HbtnsShown, FirstColShown, ColMarkP) ->
 
355
mark_marked_col(HbtnsShown, _FirstColShown, ColMarkP) ->
357
356
    #col_mark_params{virtual_col_marked = VirtualCol,
358
357
                     virtual_sort_col   = SortCol} = ColMarkP,
359
358
 
412
411
 
413
412
unmark_marked_col(undefined, _ColMarked, _SortCol) ->
414
413
    done;
415
 
unmark_marked_col(BtnId, ColMarked, SortCol) ->
 
414
unmark_marked_col(BtnId, _ColMarked, _SortCol) ->
416
415
    gs:config(BtnId, [{bg, ?DEFAULT_BG_COLOR},
417
416
                      {fg, {0,0,0}}
418
417
                     ]).
435
434
 
436
435
 
437
436
update_sort_btn_mark(ProcVars) ->
438
 
    #process_variables{first_col_shown = FirstColShown,
439
 
                       hbtns_shown     = HbtnsShown,
 
437
    #process_variables{hbtns_shown     = HbtnsShown,
440
438
                       col_mark_params = ColMarkP}  = ProcVars,
441
439
 
442
440
    #col_mark_params{col_btn_id         = MarkedColBtnId,
515
513
            gs:config(BtnId, [{bg, ?SORT_MARK_COLOR}]),
516
514
            BtnId
517
515
    end;
518
 
set_sort_btn_color(BtnId, undefined, HbtnsShown) ->
 
516
set_sort_btn_color(BtnId, undefined, _HbtnsShown) ->
519
517
    gs:config(BtnId, [{bg, ?DEFAULT_BG_COLOR}]);
520
518
set_sort_btn_color(OldSortBtnId, SortCol, HbtnsShown) ->
521
519
    case gs:read(OldSortBtnId, bg) of 
522
 
        SortBtnColor ->
 
520
        SortCol ->
523
521
               % Btn is already marked!
524
522
            OldSortBtnId;
525
523
        _OtherColor ->
554
552
%%======================================================================
555
553
 
556
554
 
557
 
update_vbtns(N, NofRowsShown, VirtualRowNo,
558
 
             Vbtns, Colors, BlinkEnabled, BlinkList) when N > NofRowsShown ->
559
 
    done;
560
 
update_vbtns(N, _NofRowsShown, VirtualRowNo, [], [], BlinkEnabled, BlinkList) ->
561
 
    done;
562
 
update_vbtns(N, _NofRowsShown, VirtualRowNo, [], Colors, BlinkEnabled, BlinkList) ->
 
555
update_vbtns(N, NofRowsShown, _VirtualRowNo,
 
556
             _Vbtns, _Colors, _BlinkEnabled, _BlinkList) when N > NofRowsShown ->
 
557
    done;
 
558
update_vbtns(_N, _NofRowsShown, _VirtualRowNo, [], [], _BlinkEnabled, _BlinkList) ->
 
559
    done;
 
560
update_vbtns(_N, _NofRowsShown, _VirtualRowNo, [], _Colors, _BlinkEnabled, _BlinkList) ->
563
561
       % Right now we don't bother with dynamically creating row buttons:
564
562
       % we ought too know in advance the maximum number of rows that can
565
563
       % be visible.
691
689
%%======================================================================
692
690
 
693
691
 
694
 
create_vbtns(N, NofRows, RowHeight, _ParId, VbtnW, _Ypos, VAcc) when N > NofRows ->
 
692
create_vbtns(N, NofRows, _RowHeight, _ParId, _VbtnW, _Ypos, VAcc) when N > NofRows ->
695
693
    lists:reverse(VAcc);
696
694
create_vbtns(N, NofRows, RowHeight, ParId, VbtnW, Ypos, VAcc) ->
697
695
    VHeight = RowHeight + 1,
698
 
    VInfo   = create_one_vbtn(ParId, RowHeight + 1, VbtnW, Ypos, N),
699
 
    create_vbtns(N + 1, NofRows, RowHeight, ParId, VbtnW, Ypos + RowHeight + 1, 
 
696
    VInfo   = create_one_vbtn(ParId, VHeight, VbtnW, Ypos, N),
 
697
    create_vbtns(N + 1, NofRows, RowHeight, ParId, VbtnW, Ypos + VHeight,
700
698
                 [VInfo | VAcc]).
701
699
    
702
700
 
752
750
%%======================================================================
753
751
 
754
752
 
755
 
update_hbtns([], HBtnsShown, 
756
 
             ResBtns, VirtualColNo, FrId, Ypos, HbtnH, ResBtnW, VbtnW) ->
 
753
update_hbtns([], _HBtnsShown, 
 
754
             _ResBtns, _VirtualColNo, _FrId, _Ypos, _HbtnH, _ResBtnW, _VbtnW) ->
757
755
    {[], []};
758
756
update_hbtns(ColsShown, HBtns, 
759
757
             ResBtns, VirtualColNo, FrId, Ypos, HbtnH, ResBtnW, VbtnW) ->
778
776
%%======================================================================
779
777
 
780
778
 
781
 
update_hbtns(N, [], 
782
 
             [], [], HbtnH, ResBtnW, VbtnW, ColNo, FrId, Xpos, Ypos, HAcc, RAcc) ->
 
779
update_hbtns(_N, [], 
 
780
             [], [], _HbtnH, _ResBtnW, _VbtnW, _ColNo, _FrId, _Xpos, _Ypos, HAcc, RAcc) ->
783
781
    {lists:reverse(HAcc), lists:reverse(RAcc)};
784
782
 
785
783
update_hbtns(N, [], [HInfo | HT], [RInfo | RT],  
792
790
                 Xpos, Ypos, HAcc, RAcc);
793
791
 
794
792
update_hbtns(1, [ColW | T], [], [],  
795
 
             HbtnH, ResBtnW, VbtnW, ColNo, FrId, Xpos, Ypos, HAcc, RAcc) ->
 
793
             HbtnH, ResBtnW, VbtnW, ColNo, FrId, _Xpos, Ypos, HAcc, RAcc) ->
796
794
       % The first button has to be bigger than the others.
797
795
    {HInfo, RInfo} = create_one_hbtn_and_resbtn(FrId, ColW - 2, 
798
796
                                                HbtnH, VbtnW - 1, 
811
809
                 [RInfo | RAcc]);
812
810
 
813
811
update_hbtns(1, [ColW | T], [HInfo | HT], [RInfo | RT], 
814
 
             HbtnH, ResBtnW, VbtnW, ColNo, FrId, Xpos, Ypos, HAcc, RAcc) ->
 
812
             HbtnH, ResBtnW, VbtnW, ColNo, FrId, _Xpos, Ypos, HAcc, RAcc) ->
815
813
    {NewHInfo, NewRInfo} = config_one_hbtn_and_resbtn(HInfo, RInfo, 
816
814
                                                      ColW - 2, 
817
815
                                                      VbtnW - 1, 
942
940
%%======================================================================
943
941
 
944
942
 
945
 
update_keys([], [], FirstCol, LastCol, HBtns, ParentId, KeyIdsAcc) ->
 
943
update_keys([], [], _FirstCol, _LastCol, _HBtns, _ParentId, KeyIdsAcc) ->
946
944
    lists:reverse(KeyIdsAcc);
947
945
 
948
946
update_keys([], [KeyId | IdT], FirstCol, LastCol, HBtns, ParentId, KeyIdsAcc) ->
952
950
 
953
951
update_keys([KeyNo | KT], [], FirstCol, LastCol, 
954
952
            HBtns,ParentId,  KeyIdsAcc) when KeyNo >= FirstCol, KeyNo =< LastCol ->
955
 
    {Width, Xpos} = get_keywidth_and_pos(KeyNo, FirstCol, HBtns),
 
953
    {_Width, Xpos} = get_keywidth_and_pos(KeyNo, FirstCol, HBtns),
956
954
    NewKeyId = create_key(ParentId, Xpos, 1),
957
955
    update_keys(KT, [], FirstCol, LastCol, HBtns, ParentId, 
958
956
                [NewKeyId | KeyIdsAcc]);
959
957
 
960
 
update_keys([KeyNo | KT], [], FirstCol, LastCol, HBtns, ParentId, KeyIdsAcc) ->
 
958
update_keys([_KeyNo | KT], [], FirstCol, LastCol, HBtns, ParentId, KeyIdsAcc) ->
961
959
    update_keys(KT, [], FirstCol, LastCol, HBtns, ParentId, 
962
960
                KeyIdsAcc);
963
961
 
970
968
    update_keys(KT, IdT, FirstCol, LastCol, HBtns, ParentId, 
971
969
                [KeyId | KeyIdsAcc]);
972
970
 
973
 
update_keys([KeyNo | KT], 
 
971
update_keys([_KeyNo | KT], 
974
972
            [KeyId | IdT], FirstCol, LastCol, HBtns, ParentId, KeyIdsAcc) ->
975
973
    update_keys(KT, [KeyId | IdT], FirstCol, LastCol, HBtns, ParentId, 
976
974
                KeyIdsAcc).
997
995
get_keywidth_and_pos(VirtualCol, FirstCol, HBtns) ->
998
996
    RealColNo = VirtualCol - FirstCol + 1,
999
997
    HBtnR = lists:nth(RealColNo, HBtns),
1000
 
    #hbtn{real_col = RealCol,
1001
 
          width = Width,
 
998
    #hbtn{width = Width,
1002
999
          xpos  = Xpos}  = HBtnR,
1003
1000
    KeyWidth = 10,
1004
1001
       % Compute the x position for the key!
1024
1021
 
1025
1022
create_key(ParentId, Xpos, Ypos) ->
1026
1023
    PicDir = code:priv_dir(tv),
1027
 
    KeyColor = ?BLACK,
1028
1024
    C = gs:canvas(ParentId, [{width, 10},
1029
1025
                             {height, 18},
1030
1026
                             {x, Xpos},