File tree 3 files changed +31
-5
lines changed
3 files changed +31
-5
lines changed Original file line number Diff line number Diff line change 2
2
#
3
3
# Authors:
4
4
# Taher Shihadeh
5
+ # Alvaro Lopez Ortega
5
6
#
6
7
# Copyright (C) 2010 Alvaro Lopez Ortega
7
8
#
20
21
# 02110-1301, USA.
21
22
#
22
23
23
- __author__ = 'Taher Shihadeh <[email protected] >'
24
-
25
24
from Widget import Widget
25
+ from Box import Box
26
+ from RawHTML import RawHTML
26
27
from Container import Container
27
28
from Server import cfg
28
29
from util import *
@@ -52,7 +53,19 @@ def Render (self):
52
53
53
54
# Render the widget
54
55
render = Widget .Render (self )
55
- render .html += HTML % ({'id' : self .id ,
56
- 'props' : props_to_str (new_props )})
56
+ render .html += HTML % ({'id' : self .id ,
57
+ 'props' : props_to_str (new_props )})
57
58
return render
58
59
60
+
61
+ class RadioText (Box ):
62
+ def __init__ (self , txt , props = {}):
63
+ Box .__init__ (self )
64
+
65
+ self .radio = Radio (props .copy ())
66
+ self += self .radio
67
+
68
+ self .text = Box ({'class' : 'radio-text' }, RawHTML (txt ))
69
+ self += self .text
70
+
71
+ self .text .bind ('click' , "$('#%s').attr('checked', true);" % (self .radio .id ))
Original file line number Diff line number Diff line change 64
64
from List import List , ListEntry
65
65
from ProgressBar import ProgressBar
66
66
from Downloader import Downloader , DownloadEntry_Factory
67
- from Radio import Radio
67
+ from Radio import Radio , RadioText
68
68
from XMLRPCProxy import XMLRPCProxy
69
69
from AjaxUpload import AjaxUpload
70
70
from Paginator import Paginator
Original file line number Diff line number Diff line change
1
+ # -*- coding: utf-8 -*-
2
+
3
+ import CTK
4
+
5
+ def default ():
6
+ page = CTK .Page ()
7
+ page += CTK .RadioText ("option 1" , {'name' : 'test16' , 'value' : 'a' })
8
+ page += CTK .RadioText ("option 2" , {'name' : 'test16' , 'value' : 'b' })
9
+ page += CTK .RadioText ("option 3" , {'name' : 'test16' , 'value' : 'c' })
10
+ return page .Render ()
11
+
12
+ CTK .publish ('' , default )
13
+ CTK .run (port = 8000 )
You can’t perform that action at this time.
0 commit comments