Конференция "KOL" » kol-Splash [Delphi, Windows]
 
  • RusSun © (12.04.10 18:00) [0]
    Доброе время суток.

    Можно ли сделать demky DemoSplash
    http://kolmck.net/demos/DemoSplash.zip
    на только на кол без мск.

    Заранее спасибо.
  • Vladimir Kladov © (12.04.10 18:06) [1]
    Можно. Делайте. :)
  • RusSun © (12.04.10 19:42) [2]
    Пробую так: знаю что не верно, но пока дальше
    не знаю как должно быть правильно:(

    program Project1;

    uses
     windows,
     kol;
    {$R *.res}
    var
    Form2,Memo1,  //Button1
    form,LabelEffect1:PControl; Start:word;
    //область для процедур
    Begin
    Form2 := NewForm( Applet, 'Form1' ).SetSize( 362, 309 ).centeronparent.Tabulate;
    Form2.Visible := False;
    Form2.Border := 6;
    Memo1 := NewEditBox( form2, [ eoMultiline, eoNoHScroll ] ).SetAlign ( caClient );
    Memo1.Color := clWindow;
    Memo1.Text := ''
    + 'To create splash form:'+#13+#10+'1. Add new form to a project (File|New Form, save it and'
    + ' drop TKOLForm component on it).'+#13+#10+'2. Remove this form from auto-create sequence '
    + '( Project|Options|Forms...|[>] ).'+#13+#10+'3. Add a code, which creates and shows splash'
    + ' form, in OnFormCreate of the main form.'+#13+#10+'4. It is a good idea to make main form'
    + ' initially ivisible, and make it visible after the finishing initialization proc'
    + 'ess.'+#13+#10;
    //область для работы
    //Button1:=NewButton(form2,'кнопка').SetSize(60,25).CenterOnParent;//размещаент объект по середине родительского.
    //Button1.OnClick:=TonEvent(MakeMethod(nil,@clickbutton));

    form:=NewForm(form2,'fmSplash').SetPosition( 335, 236 ).SetSize( 342, 215 );
    form.Font.FontHeight := 30;
    form.Font.FontName := 'Times New Roman';
        form.HasBorder := False;
        form.Color := clTeal ;
        form.Border := 0;
        LabelEffect1 := NewLabelEffect( form, 'Splash form sample', 2 ).SetPosition( 60, 92 ).AutoSize( TRUE );
        LabelEffect1.Ctl3D := False;
        LabelEffect1.Font.Color := clWhite;
        LabelEffect1.Font.FontStyle := [ fsBold ];
        LabelEffect1.Font.FontHeight := 30;
        LabelEffect1.TextAlign := taLeft;
        LabelEffect1.VerticalAlign := vaTop;
        LabelEffect1.Color2 := clBlack;
        form.Visible:=true;

    Start := GetTickCount;

     // Long initialization here (simulated)
         while GetTickCount - Start < 2000 do
     begin
       Applet.ProcessMessage;
     end;
    //form2.Visible:=true;
    run(form2);
    end.


  • biv © (13.04.10 12:28) [3]
    Вот нашел у себя(не относящиеся к теме вырезал), может пригодится

    program rdb;
    {$APPTYPE GUI}
    uses
     Windows,
     messages,
     KOL,KOLPng;

    form,
    splashform:PControl;
    png:PPngObject;
    splash_enable:boolean;
    splash_time:integer;
    splash_img:string;

    procedure DrawPaint( Dummy: Pointer; Sender: PControl; DC: HDC );
    begin
    png.DrawTransparent(PBox.Canvas.Handle, 0, 0, png.Width, png.Height, png.TransparentColor );
    end;

    procedure createsplash;
    begin
    splashform:=NewForm(Applet,form.caption);
    splashform.Border := 0;
    png:=NewPngObject;
    png.loadfromfile(GetStartDir +'splash\'+splash_img);
    splashform.Style := WS_POPUP or WS_VISIBLE;
    PBox := NewPaintBox(splashform);
    PBox.Width := png.Width ;
    PBox.Height:= png.Height;
    splashform.Width := png.Width ;
    splashform.Height:= png.Height;
    splashForm.CenterOnParent;
    PBox.OnPaint := TOnPaint( MakeMethod( nil, @DrawPaint ) );
    end;

    procedure slashrun;
    var Start:DWORD;
    begin
    createsplash;
    splashform.show;
    Start := GetTickCount;
     while GetTickCount - Start < (splash_time * 1000) do
     begin
       splashform.ProcessMessage;
     end;
    Form.Visible := true;
    splashform.free;
    end;

    procedure createform;

    begin

    form:=NewForm(Applet,'Form');
    Form.Visible := False;

    splash_enable:=true;      //Вместо прямого указания
    splash_img:='splash.png';//переменных у меня было чтение
    splash_time:=5;            //из ini-файла

    if splash_enable then slashrun else Form.Visible := True;

    end;

    begin
     createform;
     Run(form);
    end.


  • Vladimir Kladov © (13.04.10 16:00) [4]
    Мне не понятно, в чем проблема с кодом MCK. Там все уже прописано. Остается готовый код из unit1_1.inc перенести, и все. MCK только генерирует код для создания формы, и ничего больше не делает.
  • RusSun © (13.04.10 17:22) [5]
    2biv

    > Вот нашел у себя(не относящиеся к теме вырезал), может пригодится
    >


    Спасибо:) то, что надо. Уже пригождается.
 
Конференция "KOL" » kol-Splash [Delphi, Windows]
Есть новые Нет новых   [120350   +22][b:0][p:0.002]