File: main_run.cpp

package info (click to toggle)
explorer 0.72-2.1
  • links: PTS
  • area: contrib
  • in suites: hamm, slink
  • size: 1,556 kB
  • ctags: 1,203
  • sloc: cpp: 10,226; makefile: 384; sh: 206; ansic: 106; lex: 95; csh: 6
file content (71 lines) | stat: -rw-r--r-- 1,697 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71

#include "run.h"

char  temp_string [512];
char *home_path;

QPixmap *icon_map;

/*---------------------------------------------------------------------------*/
void RunClass::paintEvent (QPaintEvent *e)
{
 QPen     paint_pen    (QColor (0,0,0),0,SolidLine);
 e=e;     // compiler trick

 QPainter paint;
 paint.begin (this);
 paint.setPen (paint_pen);
 paint.drawText (60,25,"Type the name of a program, folder or document and");
 paint.drawText (60,38,"the system will open it for you");
 paint.drawText (10,65,"Open:");

 paint.drawPixmap (10,
                   15,
                   *icon_map);
 paint.end ();
}
/*---------------------------------------------------------------------------*/
void RunClass::browse ()
{
 
}
/*---------------------------------------------------------------------------*/
int main (int argc, char **argv)
{
    //>----------- make sure we have an QApplication class
    QApplication::setColorMode (QApplication::CustomColors);
    QApplication a (argc,argv);

    QFont *adj_font=new QFont ("Helvetica",10);
    a.setFont (*adj_font,TRUE);
    a.setStyle (WindowsStyle); 

    home_path=getenv ("HOME");
    if (home_path==NULL)
    {
     printf ("Unable to find environment variable [HOME]\n");
     return (1);
    }     

    icon_map=new QPixmap;
    sprintf (temp_string,"%s/run_ico.bmp",home_path);
    if (!(icon_map->load (temp_string)))
    {
      printf ("Unable to open [%s]\n",temp_string);
      return (1);
    }     

    RunClass *run_dialog=new RunClass (0,0);
   
    a.setMainWidget (run_dialog);

    run_dialog->show ();

    a.exec();

  return (0);
}
/*---------------------------------------------------------------------------*/