[#37021] [RAA] RAA/2.3 — "U.Nakamura" <usa@...>

みなさんこんにちは。

20 messages 2003/01/30

[ruby-list:36934] vruby call_parenthandler

From: Mitsuo Igarashi <mitsu5@...>
Date: 2003-01-14 06:49:57 UTC
List: ruby-list #36934
vruby について教えてください。

以下のコードはedit box の横にボタンが付いていて、そこをクリック
すると、file dialog が開いて、edit box にファイル名が入ります。
このとき、call_parenthandler で messageBox を出したいのですが、
機能しません。

require が足りないのか、include が足りないのか??
どこが悪いかが分からないのです。

よろしくご指導ください。

require 'vr/vrcontrol'

class MyFileSelectPanel < VRPanel
	include VRParent
	include VRContainersSet
	include VRCommonDialog
	
	def construct
		addControl VREdit,"edit","",10,10,200,20,WStyle::ES_AUTOHSCROLL
		addControl VRButton,"btn","...",200,10,20,20
		font=@screen.factory.newfont("Terminal",14)
		@edit.setFont font
	end
	def btn_clicked
		f=openFilenameDialog
		@edit.text=f if f
	end
	def edit_changed
		call_parenthandler("fnchanged",@edit.text)
	end
	def filename
		@edit.text
	end
end

class MyForm < VRForm
	def construct
		self.caption="Original Control"
		move 100,100,300,100 
		addControl VRStatic, "st1","file1",10,20,30,20
		addControl MyFileSelectPanel, "panel1","",40,10,250,50
	end
	def panel1_fnchnged(filname)
		messageBox " changed","FILE1"
	end
end
VRLocalScreen.start(MyForm)
				   
-------========--------
mitsu5
mitsu5@ruby.famille.ne.jp

In This Thread

Prev Next