⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 submain.pas

📁 学员管理的软件
💻 PAS
📖 第 1 页 / 共 5 页
字号:

for i:=0 to ll.Count-1 do
begin
 node:=tv1.Items.Add(tv1.Selected,ll.Strings[i]);
 node.ImageIndex:=0;
 node.SelectedIndex:=0;
 s:=node.Text;
    with main.DataModule2 do
    begin
    aq1.Close;
    aq1.SQL.Clear;
    aq1.SQL.Add('SELECT distinct name from 知识点表');
    aq1.Open;
        while not aq1.Eof do
        begin
         tempnode:=form1.TV1.Items.AddChild(node,aq1.FieldValues['name']);
             s:=tempnode.Text;
             with main.DataModule2 do
             begin
             aq2.Close;
             aq2.SQL.Clear;
             aq2.SQL.Add('SELECT distinct name from 题型表');
             aq2.Open;
             while not aq2.Eof do
             begin
              temppnode:=form1.TV1.Items.AddChild(tempnode,aq2.FieldValues['name']);
              aq2.Next;
             end;
             end;
         aq1.Next;
        end;
    end;
end;
end;

procedure tform1.tvclear;
var
i:integer;
begin
for i:=tv1.Items.Count -1 downto 6  do
begin
   if tv1.Items[i].HasChildren  then
        tv1.Items[i].DeleteChildren;
   tv1.items[i].Delete;
end;
end;


procedure TForm1.N71Click(Sender: TObject);
begin
tvclear;
end;

procedure TForm1.N52Click(Sender: TObject);
var
i:integer;
begin
tvclear;
tvfresh;
for i:=tv1.Items.Count -1 downto 0  do
begin
   if tv1.Items[i].Level = 2  then
      tv1.Items[i].ImageIndex:=1;
end;
end;

procedure TForm1.N54Click(Sender: TObject);
begin
if N54.Checked then
begin
coolbar1.Visible:=false;
N54.Caption:='工具栏显示';
end
else
begin
coolbar1.Visible:=true;
N54.Caption:='工具栏隐藏';
end;
N54.Checked:=not N54.Checked;
end;

procedure TForm1.N55Click(Sender: TObject);
begin
if N55.Checked then
begin
tv1.Visible:=false;
N55.Caption:='树型显示';
end
else
begin
tv1.Visible:=true;
N55.Caption:='树型隐藏';
end;
N55.Checked:=not N55.Checked;
end;

procedure TForm1.N57Click(Sender: TObject);
begin
N31click(sender);
end;

procedure TForm1.N58Click(Sender: TObject);
begin
N21click(sender);
end;

procedure TForm1.N59Click(Sender: TObject);
begin
N22click(sender);
end;

procedure TForm1.N61Click(Sender: TObject);
begin
toolbar1.Color:=clbtnface;
tv1.Color:=clbtnface;
panel1.Color:=clbtnface;
end;

procedure TForm1.N62Click(Sender: TObject);
begin
toolbar1.Color:=clSkyBlue;
tv1.Color:=clSkyBlue;
panel1.Color:=clSkyBlue;
end;

procedure TForm1.N63Click(Sender: TObject);
begin
if colordialog1.Execute then
begin
toolbar1.Color:=colordialog1.Color;
tv1.Color:=colordialog1.Color;
panel1.Color:=colordialog1.Color;
end;
end;

procedure TForm1.N69Click(Sender: TObject);
var
myfile:Tinifile;
begin
myfile:=Tinifile.Create(extractfilepath(application.ExeName)+'myfile.ini');
myfile.WriteString('color_set','tree',colortostring(tv1.Color));
myfile.WriteString('color_set','toolbar',colortostring(toolbar1.Color));
myfile.WriteString('color_set','panel',colortostring(panel1.Color));
myfile.Free;
showmessage('保存成功');
end;

procedure TForm1.N70Click(Sender: TObject);
var
myfile:Tinifile;
begin
myfile:=Tinifile.Create(extractfilepath(application.ExeName)+'myfile.ini');
tv1.Color:=stringtocolor(myfile.readString('color_set','tree','clbtnface'));
toolbar1.Color:=stringtocolor(myfile.readString('color_set','toolbar','clbtnface'));
panel1.Color:=stringtocolor(myfile.readString('color_set','panel','clbtnface'));
myfile.Free;
end;
procedure TForm1.TV1DblClick(Sender: TObject);
begin
if (trim(tv1.Selected.Text)='帮助主题') then
  shellexecute(handle,'open','help.chm',nil,nil,sw_normal); 
if (trim(tv1.Selected.Text)='新建') then
  N2click(sender);
if (trim(tv1.Selected.Text)='查询') then
  N3.Click;
end;

procedure TForm1.N36Click(Sender: TObject);
begin
if global.blnopensound then
playsound('retry.wav');
graphic_exam.F_exam_graphic.Show;
end;

procedure TForm1.N45Click(Sender: TObject);
begin
if global.blnopensound then
playsound('click.wav');
shellexecute(handle,'open','help.chm',nil,nil,sw_normal);
end;

procedure TForm1.N40Click(Sender: TObject);
begin
if global.blnopensound then
playsound('retry.wav');
other_graphic.F_other_graphic.Show;
end;

procedure TForm1.N73Click(Sender: TObject);
begin
if global.blnopensound then
playsound('click.wav');
report_st.F_report_st.QuickRep1.Preview;
end;

procedure TForm1.N75Click(Sender: TObject);
begin
if global.blnopensound then
playsound('click.wav');
U_prn_set.F_prn_set.Show;
end;

procedure TForm1.N76Click(Sender: TObject);
begin
if global.blnopensound then
playsound('click.wav');
U_global_setting.F_setting.Show;
U_global_setting.F_setting.PageControl1.ActivePageIndex:=0;
end;

procedure TForm1.ToolButton28Click(Sender: TObject);
var
pl,pr,pt,pb:integer;
px,py:integer;
ps:integer;
lh:integer;
i:integer;
x,y:integer;
rowb,colb:integer;
myfile:Tinifile;
S:STRING;
begin
myfile:=Tinifile.Create(extractfilepath(application.ExeName)+'myfile.ini');
pl:=myfile.ReadInteger('grid_print','left_margine',1);
pr:=myfile.ReadInteger('grid_print','right_margine',1);
pt:=myfile.ReadInteger('grid_print','top_margine',1);
pb:=myfile.ReadInteger('grid_print','buttom_margine',1);

rowb:=myfile.ReadInteger('grid_print','horz',5);
colb:=myfile.ReadInteger('grid_print','vert',5);

px:=trunc(getdevicecaps(printer.Handle,LOGPIXELSX)/2.54);
py:=trunc(getdevicecaps(printer.Handle,LOGPIXELSY)/2.54);

ps:=trunc(getdevicecaps(printer.Handle,LOGPIXELSX)
/SCREEN.PixelsPerInch);

S:=myfile.READString('grid_print','print_pos','横向打印');
if s='横向打印' then
printer.Orientation:=poportrait
else
printer.Orientation:=polandscape;

printer.Canvas.Font.Name:=myfile.ReadString('grid_print','font_name','宋体');
printer.Canvas.Font.Size:=myfile.ReadInteger('grid_print','font_size',12);
printer.Canvas.Font.Color:=clred;
printer.Canvas.Pen.Color:=clblue;
lh:=printer.Canvas.TextHeight(dbgrid1.Font.Name);
x:=px*pl;
y:=py*pt;
if (dbgrid1.DataSource.DataSet.Active=true) and (dbgrid1.DataSource.DataSet.RecordCount > 0) then
begin
  printer.Title:='相关试题一览表';
  with printer do
  begin
    begindoc;
    dbgrid1.DataSource.DataSet.First;
    while not dbgrid1.DataSource.DataSet.Eof do
    begin
      for i:=0 to dbgrid1.FieldCount -1 do
      begin
        if (x+dbgrid1.Columns.Items[i].Width * ps)
        <=(pagewidth-ps*pr) then
        begin
          printer.Canvas.Rectangle(x,y,x+dbgrid1.Columns.Items[i].Width*ps,y+lh);
          if y=py*pt then
          canvas.TextOut(x+rowb,y+colb,
          dbgrid1.Columns[i].Title.Caption)
          else
          printer.Canvas.TextOut(x+rowb,y+colb,
          dbgrid1.Fields[i].AsString);
        end;
        x:=x+dbgrid1.Columns.Items[i].Width*ps;
      end;
      if not (y=py*pt) then
      dbgrid1.DataSource.DataSet.Next;
      x:=px*pl;
      y:=y+lh;
      if(y+lh)>(pageheight-py*pb) then
      begin
        newpage;
        x:=px*pl;
        y:=py*pt;
      end;
    end;
    enddoc;
  end;
  dbgrid1.DataSource.DataSet.First;
  messagedlg('已经打印完成',mtinformation,[mbok],0);
end;
end;

procedure TForm1.Timer1Timer(Sender: TObject);
type
arr=array[0..1] of char;
var
myfile:Tinifile;
s,temp,temp1,temp2,temp3,temp4:string;
ispmd:boolean;
arrr,arrr1,arrr2,arrr3,arrr4:array[0..40] of arr;
i,i1,i2,i3,i4,index3,index4,index,index1,index2:integer;
begin
index:=0;
index1:=0;
index2:=0;
index3:=0;
index4:=0;
myfile:=Tinifile.Create(extractfilepath(application.ExeName)+'myfile.ini');
s:='';
ispmd:=myfile.ReadBool('other_setting','pmd',false);
if ispmd then
begin
  temp:=application.Title;
  temp1:=label3.Caption;
  temp2:=label4.Caption;
  temp3:=sb.Panels[0].Text;
  temp4:=sb.Panels[1].Text;

  if not ex4 then
  begin
  temp:='  '+temp;
  temp1:='  '+temp1;
  temp2:='  '+temp2;
  temp3:='  '+temp3;
  temp4:='  '+temp4;
  end;
  ex4:=true;
  i:=length(temp) div 2;
  i1:=length(temp1) div 2;
  i2:=length(temp2) div 2;
  i3:=length(temp3) div 2;
  i4:=length(temp4) div 2;

  if i>=40 then
  begin
    showmessage('字数超过40,不支持跑马灯效果');
    exit;
  end;
  if i1>=40 then
  begin
    showmessage('字数超过40,不支持跑马灯效果');
    exit;
  end;
  if i2>=40 then
  begin
    showmessage('字数超过40,不支持跑马灯效果');
    exit;
  end;
  if i3>=40 then
  begin
    showmessage('字数超过40,不支持跑马灯效果');
    exit;
  end;
  if i4>=40 then
  begin
    showmessage('字数超过40,不支持跑马灯效果');
    exit;
  end;

  if index=i then index:=0;
  if index1=i1 then index1:=0;
  if index2=i2 then index2:=0;
  if index3=i3 then index3:=0;
  if index4=i4 then index4:=0;

  arrr[index][0]:=temp[1];
  arrr[index][1]:=temp[2];
  arrr1[index1][0]:=temp1[1];
  arrr1[index1][1]:=temp1[2];
  arrr2[index2][0]:=temp2[1];
  arrr2[index2][1]:=temp2[2];
  arrr3[index3][0]:=temp3[1];
  arrr3[index3][1]:=temp3[2];
  arrr4[index4][0]:=temp4[1];
  arrr4[index4][1]:=temp4[2];

  temp:=temp+arrr[index];
  temp1:=temp1+arrr1[index1];
  temp2:=temp2+arrr2[index2];
  temp3:=temp3+arrr3[index3];
  temp4:=temp4+arrr4[index4];

  inc(index);
  inc(index1);
  inc(index2);
  inc(index3);
  inc(index4);

  temp:=copy(temp,3,length(temp)-1);
  temp1:=copy(temp1,3,length(temp1)-1);
  temp2:=copy(temp2,3,length(temp2)-1);
  temp3:=copy(temp3,3,length(temp3)-1);
  temp4:=copy(temp4,3,length(temp4)-1);

  application.Title:=temp;
  form1.Caption:=temp;
  label3.Caption:=temp1;
  label4.Caption:=temp2;
  sb.Panels[0].Text:=temp3;
  sb.Panels[1].Text:=temp4;
end
else
begin
  ex4:=false;
  application.Title:='远程教育考试平台';
  form1.Caption:=application.Title;
  label3.Caption:=label3_str;
  label4.Caption:=label4_str;
end;
if myfile.ReadBool('other_setting','auto_show_keybroad',true) then
begin
if getkeystate(VK_INSERT)=1 then
  s:='【MODIFY】'
ELSE
  s:='【INSERT】';
IF GETKEYSTATE(VK_CAPITAL)=1 THEN
  s:=s+'【大写键开】'
ELSE
  s:=s+'【大写键关】';
if getkeystate(VK_NUMLOCK)=1 then
  s:=s+'【数字键开】'
ELSE
  s:=s+'【数字键关】';
end;
s:=s+'【' + FormatDateTime('yyyy-mm-dd hh:mm:ss',now)+'】';
sb.Panels[3].Text:=s;
myfile.Free;
global.which_pic:=not global.which_pic;
if global.which_pic then
   image1.Picture.LoadFromFile(extractfilepath(application.ExeName)+'soft_pic/software_pic.jpg')
else
   image1.Picture.LoadFromFile(extractfilepath(application.ExeName)+'soft_pic/software_pic1.jpg');
end;

procedure TForm1.N74Click(Sender: TObject);
var
colstr:string;
i:integer;
s:string;
begin
if global.blnopensound then
playsound('click.wav');
colstr:='';
if messagedlg('您是否已经进行试卷的输出设置?'
+#13+#10+'如果点''是'',进行配置'+#13+#10
+'如果点''否'',按您配置进行报表输出'+#13+#10+
'注意:为了布局清晰,输出项数不要超过6项',mtwarning,[mbyes,mbno],0)=mryes then
begin
  U_global_setting.F_setting.ShowModal;
 U_global_setting.F_setting.PageControl1.ActivePageIndex:=5;
 exit;
end
else
begin
with U_global_setting.F_setting do
 begin
    for i:=0 to checklistbox1.Items.Count -1 do
    begin
      if checklistbox1.Checked[i] then
      begin
        if i=4 then
        begin
          colstr:=colstr+'题型表.name AS 题型,';
          continue
        end
        else if i=0 then
        begin
          colstr:=colstr+'试卷表.试卷号 AS 试卷号,';
          continue;
        end
        else if i=11 then
        begin
          colstr:=colstr+'题库表.name AS 题库名,';
          continue;
        end
        else if i=12 then
        begin
          colstr:=colstr+'知识点表.name AS 大知识点,';
          continue;
        end
        else if i=13 then
        begin
          colstr:=colstr+'知识点表.subname AS 子知识点,';
          continue;
        end
        else if i=14 then

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -