55#include <LCUI/timer.h>
66#include <LCUI/gui/widget.h>
77#include <LCUI/gui/widget/textedit.h>
8+ #include <LCUI/gui/widget/scrollbar.h>
89#include "frame.h"
910#include "router.h"
1011
@@ -19,6 +20,9 @@ typedef struct FrameViewRec_ {
1920 LCUI_Widget btn_home ;
2021 LCUI_Widget input ;
2122 LCUI_Widget content ;
23+ LCUI_Widget client ;
24+ LCUI_Widget vscrollbar ;
25+ LCUI_Widget hscrollbar ;
2226} FrameViewRec , * FrameView ;
2327
2428static size_t frame_id_count = 0 ;
@@ -105,19 +109,30 @@ static void FrameView_OnInit(LCUI_Widget w)
105109 self -> btn_refresh = LCUIWidget_New ("icon" );
106110 self -> input = LCUIWidget_New ("textedit" );
107111 self -> content = LCUIWidget_New ("router-view" );
112+ self -> client = LCUIWidget_New (NULL );
113+ self -> vscrollbar = LCUIWidget_New ("scrollbar" );
114+ //self->hscrollbar = LCUIWidget_New("scrollbar");
115+ //ScrollBar_BindTarget(self->hscrollbar, self->content);
116+ ScrollBar_BindTarget (self -> vscrollbar , self -> content );
117+ //ScrollBar_SetDirection(self->hscrollbar, SBD_HORIZONTAL);
108118 Widget_SetAttribute (w , "router" , router_name );
109119 Widget_AddClass (w , "v-frame" );
110- Widget_AddClass (self -> navbar , "c-navbar" );
120+ Widget_AddClass (self -> navbar , "c-navbar v-frame__navbar " );
111121 Widget_AddClass (self -> btn_back , "c-navbar__btn" );
112122 Widget_AddClass (self -> btn_forward , "c-navbar__btn" );
113123 Widget_AddClass (self -> btn_home , "c-navbar__btn" );
114124 Widget_AddClass (self -> btn_refresh , "c-navbar__btn" );
115125 Widget_AddClass (self -> input , "c-navbar__input" );
126+ Widget_AddClass (self -> content , "v-frame__content" );
127+ Widget_AddClass (self -> client , "v-frame__client" );
116128 Widget_Append (self -> navbar , self -> btn_back );
117129 Widget_Append (self -> navbar , self -> btn_forward );
118130 Widget_Append (self -> navbar , self -> btn_refresh );
119131 Widget_Append (self -> navbar , self -> btn_home );
120132 Widget_Append (self -> navbar , self -> input );
133+ Widget_Append (self -> client , self -> content );
134+ Widget_Append (self -> client , self -> vscrollbar );
135+ //Widget_Append(self->client, self->hscrollbar);
121136 Icon_SetName (self -> btn_back , "arrow-left" );
122137 Icon_SetName (self -> btn_forward , "arrow-right" );
123138 Icon_SetName (self -> btn_refresh , "refresh" );
@@ -129,7 +144,7 @@ static void FrameView_OnInit(LCUI_Widget w)
129144 Widget_BindEvent (self -> btn_home , "click" , FrameView_OnBtnHomeClick ,
130145 self , NULL );
131146 Widget_Append (w , self -> navbar );
132- Widget_Append (w , self -> content );
147+ Widget_Append (w , self -> client );
133148 FrameView_OnRouteUpdate (w , router_get_current_route (self -> router ),
134149 NULL );
135150}
0 commit comments