[已答复] text看不到

[复制链接]
lihui81 发表于 2010-4-21 16:52:27
在刘老师的指导后,决定自己写finger,可是在上面写了text后,也生成了句柄,就是看不到text,怎么回事呢
程序:hplt1=uicontrol(xishjiem,'style','text','unit','normalized','position',[0.1,1,0.25,0.14],'string','配料损失比例')
       get(hplt1)
获得的属性BackgroundColor = [0.92549 0.913725 0.847059]
Callback =
CData = []
Enable = on
Extent = [0 0 0.125 0.0428571]
FontAngle = normal
FontName = MS Sans Serif
FontSize = [8]
FontUnits = points
FontWeight = normal
ForegroundColor = [0 0 0]
HorizontalAlignment = center
KeyPressFcn =
ListboxTop = [1]
Max = [1]
Min = [0]
Position = [0.1 1 0.25 0.14]
String = 配料损失比例
Style = text
SliderStep = [0.01 0.1]
TooltipString =
Units = normalized
Value = [0]
BeingDeleted = off
ButtonDownFcn =
Children = []
Clipping = on
CreateFcn =
DeleteFcn =
BusyAction = queue
HandleVisibility = on
HitTest = on
Interruptible = on
Parent = [1]
Selected = off
SelectionHighlight = on
Tag =
Type = uicontrol
UIContextMenu = []
UserData = []
Visible = on

3 条回复


lihui81 发表于 2010-4-21 17:27:53

第一次自己写,什么都不会了

hzhqt1=uicontrol(xishjiem,'style','text','unit','normalized','position',[0.1,1,0.25,0.14],'string','送蒸气干燥比例')
     
       hzhqe1=uicontrol(xishjiem,'style','edit','unit','normalized','position',[0.4,1.0,0.25,0.14],'string',num2str(0.545),...
           'callback',['global morluj;','xzhg1=0-str2num(get(gcbo,''string''));','xiuxi=[morluj ''\xishu.xls''];','xlswrite(xiuxi,xzhg1,''sheet1'',''B4:B4'')'])
       hzhqt2=uicontrol(xishjiem,'style','text','unit','normalized','position',[0.1,0.7,0.25,0.14],'string','蒸气干燥损失比例')
     
       hzhqe2=uicontrol(xishjiem,'style','edit','unit','normalized','position',[0.4,0.7,0.25,0.14],'string',num2str(0.002),...
           'callback',['global morluj;','xzhg2=0-str2num(get(gcbo,''string''));','xiuxi=[morluj ''\xishu.xls''];','xlswrite(xiuxi,xzhg2,''sheet1'',''C6:C6'')'])
然后出来是下面这样的,怎么改啊
Snap1.jpg

lihui81 发表于 2010-4-22 05:07:21

改了颜色设置没有反应

我开始是用的inputdlg让用户输入几个参数,可是不知道怎么获得对话框句柄来修改它的图标,然后就想自己写figure上的控件,可是怎么老是不对,前面定义好变量写在callback里都不认识,只好都在callback里写了,然后写好后都看不到控件,或者位置乱七八糟的,能不能给指点一下

lihui81 发表于 2010-4-22 07:12:42

求教

就是下面的程序,运行后只有一个figure,上面什么控件都没有,这是怎么回事?
global morluj
danh=[0.18,43.89,42.26,6.78,144.79,128.79];

danhjiem=figure('name','单耗修改界面','numbertitle','off');

set(danhjiem, 'toolbar', 'none');%关闭
set(danhjiem, 'MenuBar', 'none');

         javaFrame = get(danhjiem,'JavaFrame');
set(javaFrame,'FigureIcon',javax.swing.ImageIcon([morluj,'\ahutico.jpg']));
hymt1=uicontrol(xishjiem,'style','text','unit','normalized','position',[0.1,1,0.25,0.14],'string','原煤单耗')
      
       hyme1=uicontrol(xishjiem,'style','edit','unit','normalized','position',[0.4,1.0,0.25,0.14],'BackgroundColor',[0.1 0.1 0.1],'string',num2str(danh(1)),...
           'callback',['xdh1=str2num(get(gcbo,''string''));','danh(1)=xdh1;'])
       htrqt2=uicontrol(xishjiem,'style','text','unit','normalized','position',[0.1,0.85,0.25,0.14],'string','天然气单耗')
      
       htrqe2=uicontrol(xishjiem,'style','edit','unit','normalized','position',[0.4,0.85,0.25,0.14],'BackgroundColor',[0.1 0.1 0.1],'string',num2str(danh(2)),...
           'callback',['xdh2=str2num(get(gcbo,''string''));','danh(2)=xdh2;'])
       hzhyt3=uicontrol(xishjiem,'style','text','unit','normalized','position',[0.1,0.7,0.25,0.14],'string','重油单耗')
      
       hzhye3=uicontrol(xishjiem,'style','edit','unit','normalized','position',[0.4,0.7,0.25,0.14],'BackgroundColor',[0.1 0.1 0.1],'string',num2str(danh(3)),...
           'callback',['xdh3=str2num(get(gcbo,''string''));','danh(3)=xdh3;'])
       hyjjt4=uicontrol(xishjiem,'style','text','unit','normalized','position',[0.1,0.55,0.25,0.14],'string','冶金焦单耗')
      
       hyjje4=uicontrol(xishjiem,'style','edit','unit','normalized','position',[0.4,0.55,0.25,0.14],'BackgroundColor',[0.1 0.1 0.1],'string',num2str(danh(4)),...
           'callback',['xdh4=str2num(get(gcbo,''string''));','danh(4)=xdh4;'])
       hdlt5=uicontrol(xishjiem,'style','text','unit','normalized','position',[0.1,0.4,0.25,0.14],'string','电力单耗')
      
       hdle5=uicontrol(xishjiem,'style','edit','unit','normalized','position',[0.4,0.4,0.25,0.14],'BackgroundColor',[0.1 0.1 0.1],'string',num2str(danh(5)),...
           'callback',['xdh5=str2num(get(gcbo,''string''));','danh(5)=xdh5;'])
       hzhqt6=uicontrol(xishjiem,'style','text','unit','normalized','position',[0.1,0.25,0.25,0.14],'string','蒸气单耗')
      
       hzhqe6=uicontrol(xishjiem,'style','edit','unit','normalized','position',[0.4,0.25,0.25,0.14],'BackgroundColor',[0.1 0.1 0.1],'string',num2str(danh(6)),...
           'callback',['xdh6=str2num(get(gcbo,''string''));','danh(6)=xdh6;'])
您需要登录后才可以回帖 登录 | 注册

本版积分规则

相关帖子
相关文章
热门教程
站长推荐
快速回复 返回顶部 返回列表