Перейти к содержанию
Fire Monkey от А до Я

sasha

Пользователи
  • Постов

    1
  • Зарегистрирован

  • Посещение

Посетители профиля

Блок последних пользователей отключён и не показывается другим пользователям.

Достижения sasha

  1. Приветствую! Некорректно отрабатывает поток в Андройде, а именно мерцания экрана procedure Tspotok.Add; begin Form1.foot.Add(Form1.ListBox1); end; procedure Tspotok.Add2; begin Form1.st.Add(Form1.ListBox1); end; procedure Tspotok.Add3; begin Form1.st.ListImage.Items[Form1.st.ListvName.Count-1].Bitmap.LoadFromStream(BlobStream); end; procedure Tspotok.Execute; var FDConnection1: TFDConnection; FDQuery1: TFDQuery; FDPhysSQLiteDriverLink1: TFDPhysSQLiteDriverLink; FDGUIxWaitCursor1: TFDGUIxWaitCursor; j,i:integer; begin FDConnection1:=TFDConnection.Create(nil); FDConnection1.DriverName:='SQLite'; FDPhysSQLiteDriverLink1:=TFDPhysSQLiteDriverLink.Create(nil); FDGUIxWaitCursor1:=TFDGUIxWaitCursor.Create(nil); FDQuery1:=TFDQuery.Create(nil); {$IFDEF ANDROID} FDConnection1.Params.Values['Database'] := TPath.Combine(TPath.GetDocumentsPath, 'base.db'); {$ENDIF} {$IFDEF MSWINDOWS} FDConnection1.Params.Values['Database'] :='E:\Embarcadero\Studio\Projects\NANDBOOK_TWO\base.db'; {$ENDIF} FDConnection1.Connected:=TRUE; for I := 0 to 16 do begin FDQuery1.SQL.Text:='SELECT * FROM '+Form1.NameBaseconst+' WHERE name LIKE "'+Form1.v+'%"'; FDQuery1.Connection:=FDConnection1; FDQuery1.Active := True; FDQuery1.Open; Synchronize(Add); Form1.foot.ListvName.Items[Form1.foot.List.Count-1].Text:=Form1.NameB; if FDQuery1.RecordCount=0 then begin Form1.foot.List.Items[Form1.foot.List.Count-1].Visible:=false; end; if not FDQuery1.IsEmpty then begin //Log.d('LOG-FDQuery1.RecordCount='+FDQuery1.RecordCount.ToString()); for j := 0 to FDQuery1.RecordCount-1 do begin Synchronize(Add2); Form1.st.List.Items[Form1.st.ListvName.Count-1].Parent:= Form1.ListBox1; Form1.st.ListTag.Items[Form1.st.ListvName.Count-1].Text:=IntToStr(Form1.ListBox1.Count-1); Form1.st.ListvName.Items[Form1.st.ListvName.Count-1].Text :=FDQuery1.FieldByName('name').AsString; Form1.st.ListBase.Items[Form1.st.ListvName.Count-1].Text :=Form1.NameBaseconst; Form1.st.ListID.Items[Form1.st.ListvName.Count-1].Text :=FDQuery1.FieldByName('id').AsString; BlobStream:=TStream.Create; BlobStream := FDQuery1.CreateBlobStream(FDQuery1.FieldByName('image'),TBlobStreamMode.bmRead); Synchronize(Add3); FDQuery1.Next; end; end; FDQuery1.Close; FDQuery1.Active := false; end; FDConnection1.Connected:=false; end; end. А в осном unite var QW:Tspotok; .. QW:=Tspotok.Create(true); QW.FreeOnTerminate:=true; QW.Resume;
×
×
  • Создать...