📄 fileopermenu.lst
字号:
C51 COMPILER V7.06 FILEOPERMENU 05/14/2007 22:03:39 PAGE 1
C51 COMPILER V7.06, COMPILATION OF MODULE FILEOPERMENU
OBJECT MODULE PLACED IN FileOperMenu.OBJ
COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE FileOperMenu.c LARGE BROWSE DEBUG OBJECTEXTEND
stmt level source
1 #include "LCD_FUN.H"
2 #define MENUNUM 6
3 #define CHDISPMAX 2
4 uchar code CHIMenuText[][6]={
5 {66,65,0},//打开
6 {70,71,0},//属性
7 {72,73,0},//复制
8 {76,77,0},//剪切
9 {74,75,0},//删除
10 {80,81,0}, //粘贴
11 {56,57,70,71,0},//优盘属性
12 {109,110,88,89,90,0}//新建文件夹
13 };
14 typedef struct
15 {
16 uchar TextIndex;
17 uchar TextNum;
18 }MeunTextStru;
19 MeunTextStru code MenuText[]={
20 {0,8}
21 };
22 uchar *Item_MenuText(uchar Index,Item)
23 {
24 1 return CHIMenuText[Item+Index];
25 1 }
26 uchar Item=0;
27 extern uchar where;
28 uchar IndexNum=0;
29 //extern uchar ItemPlace[MENUNUM];
30 //extern uchar SaveIndex[MENUNUM];
31 //uchar SaveItem[MENUNUM];
32 uchar ItemMaxNum;
33 //uchar MenuLay=0;
34 //---------------菜单处理函数----------------------------------------------------
35 void Menu_Up(void)
36 { uchar ItemBackup;
37 1 uchar i,Menu_j;
38 1 ItemBackup=Item;
39 1 if(Item==0)
40 1 Item=ItemMaxNum-1;//最大条项数
41 1 else
42 1 Item--;
43 1 if(where==0)//如果现在是在顶项处
44 1 {
45 2 if(CHDISPMAX>=ItemMaxNum-1)//如果可以显示所有项。则由顶项跳到底项。
46 2 {
47 3 where=ItemMaxNum-1;
48 3 GUI_DispStringAt(Item_MenuText(IndexNum,ItemBackup),0,0,6,0,0);
49 3 GUI_DispStringAt(Item_MenuText(IndexNum,Item),where,0,6,0,1);
50 3 }
51 2 else//否则所有项下移一行。
52 2 {
53 3 GUI_DispStringAt(Item_MenuText(IndexNum,Item),0,0,6,0,1);//显示当前项目
54 3 Menu_j=Item;
55 3 for(i=1;i<3;i++)//显示其它项
C51 COMPILER V7.06 FILEOPERMENU 05/14/2007 22:03:39 PAGE 2
56 3 { Menu_j++;
57 4 if(Menu_j>ItemMaxNum-1)
58 4 Menu_j=0;
59 4 GUI_DispStringAt(Item_MenuText(IndexNum,Menu_j),i,0,6,0,0);
60 4 }
61 3 }
62 2 }
63 1 else
64 1 {
65 2 where--;
66 2 GUI_DispStringAt(Item_MenuText(IndexNum,Item),where,0,6,0,1);
67 2 GUI_DispStringAt(Item_MenuText(IndexNum,ItemBackup),where+1,0,6,0,0);
68 2 }
69 1 GUI_ScrollBar(ItemMaxNum, Item);
70 1 }
71 void Menu_Down(void)
72 { uchar ItemBackup;
73 1 uchar i,Menu_j;
74 1 ItemBackup=Item;
75 1 if(Item==ItemMaxNum-1)
76 1 Item=0;
77 1 else
78 1 Item++;
79 1 if(where==CHDISPMAX||where==ItemMaxNum-1)//如果位于显示末项
80 1 {
81 2 if(CHDISPMAX>=ItemMaxNum-1)//如果可以显示所有项。则由底项跳到顶项。
82 2 {
83 3 where=0;
84 3 GUI_DispStringAt(Item_MenuText(IndexNum,Item),where,0,6,0,1);
85 3 GUI_DispStringAt(Item_MenuText(IndexNum,ItemBackup),ItemMaxNum-1,0,6,0,0);
86 3 }
87 2 else
88 2 {
89 3 GUI_DispStringAt(Item_MenuText(IndexNum,Item),2,0,6,0,1);
90 3 Menu_j=Item;
91 3 for(i=CHDISPMAX;i>0;i--)
92 3 { Menu_j--;
93 4 if(Menu_j==255)
94 4 Menu_j=ItemMaxNum-1;
95 4 GUI_DispStringAt(Item_MenuText(IndexNum,Menu_j),i-1,0,6,0,0);
96 4 }
97 3 }
98 2 }
99 1 else
100 1 {
101 2 where++;
102 2 GUI_DispStringAt(Item_MenuText(IndexNum,Item),where,0,6,0,1);
103 2 GUI_DispStringAt(Item_MenuText(IndexNum,ItemBackup),where-1,0,6,0,0);
104 2 }
105 1 GUI_ScrollBar(ItemMaxNum, Item);
106 1 }
107 //---------------------根据条层选择号和所在位置刷新屏幕显示条层的内容---------------------------------
108 void Menu_Redisp(uchar whereI,uchar ItemJ)
109 {
110 1 uchar i;
111 1 uchar Menu_j;
112 1 GUI_DispStringAt(Item_MenuText(IndexNum,ItemJ),whereI,0,6,0,1);//显示当前选项
113 1 //显示其它选项。
114 1 Menu_j=ItemJ;
115 1 for(i=whereI;i>0;i--)//显示当前项上面部分。
116 1 {
117 2 if(Menu_j==0)
C51 COMPILER V7.06 FILEOPERMENU 05/14/2007 22:03:39 PAGE 3
118 2 Menu_j=ItemMaxNum-1;
119 2 else
120 2 Menu_j--;
121 2 GUI_DispStringAt(Item_MenuText(IndexNum,Menu_j),i-1,0,6,0,0);
122 2 }
123 1 Menu_j=ItemJ;
124 1 for(i=whereI+1;i<=CHDISPMAX;i++)//显示当前项下面部分。
125 1 {
126 2 if(i>ItemMaxNum-1)//如果所要显示项目小于最大显示数,则只显示到ItemMaxNum-1
127 2 break;
128 2 if(Menu_j==ItemMaxNum-1)
129 2 Menu_j=0;
130 2 else
131 2 Menu_j++;
132 2 GUI_DispStringAt(Item_MenuText(IndexNum,Menu_j),i,0,6,0,0);
133 2 }
134 1 GUI_ScrollBar(ItemMaxNum, Item);
135 1 }
136 void FileOperInit(void)
137 { LCD_clr();
138 1 Item=0;
139 1 where=0;
140 1 IndexNum=0;
141 1 ItemMaxNum=MenuText[0].TextNum;
142 1 Menu_Redisp(where,Item);
143 1 LCD_set_RC(3,0);
144 1 LCD_putc(47,0);LCD_putc(48,0);//显示 -操作
145 1 LCD_set_RC(3,5);
146 1 LCD_putc(45,0);LCD_putc(46,0);//显示 -返回
147 1 }
MODULE INFORMATION: STATIC OVERLAYABLE
CODE SIZE = 917 ----
CONSTANT SIZE = 50 ----
XDATA SIZE = 3 10
PDATA SIZE = ---- ----
DATA SIZE = ---- ----
IDATA SIZE = ---- ----
BIT SIZE = ---- ----
END OF MODULE INFORMATION.
C51 COMPILATION COMPLETE. 0 WARNING(S), 0 ERROR(S)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -