Forum alanını kullanabilirmiyiz acaba bu konu ile ilgili olarak....
.PAS uzantılı dosyalar text tabanlı oldugu icin buraya koyulabilir
ORNEK
**************
unit fMalzemeKodSec;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, Db, DBTables, ExtCtrls, Grids, DBGrids, Buttons, dxDBGrid,
dxTL, dxDBCtrl, dxCntner;
type
TMalzemeKodSec = class(TForm)
FormPanel: TPanel;
ScrollBox1: TScrollBox;
MKodSecDbGrid: TdxDBGrid;
MKodSecDbGridStokKodu: TdxDBGridMaskColumn;
MKodSecDbGridMalKodu: TdxDBGridMaskColumn;
MKodSecDbGridMalzemeAd: TdxDBGridColumn;
MKodSecDbGridStokYerAd: TdxDBGridMaskColumn;
MKodSecDbGridMiktar: TdxDBGridMaskColumn;
MKodSecDbGridBirimAd: TdxDBGridColumn;
Panel1: TPanel;
Label1: TLabel;
Edit1: TEdit;
Panel2: TPanel;
SpeedButton1: TSpeedButton;
SpeedButton3: TSpeedButton;
procedure Edit1Change(Sender: TObject);
procedure SpeedButton1Click(Sender: TObject);
procedure SpeedButton3Click(Sender: TObject);
procedure FormActivate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
StokKodSt : String;
function Execute : boolean;
end;
var
MalzemeKodSec: TMalzemeKodSec;
implementation
{$R *.DFM}
uses modDMStox;
function TMalzemeKodSec.Execute : boolean;
begin
if MalzemeKodSec = nil then
begin
Application.CreateForm(TMalzemeKodSec, MalzemeKodSec);
MalzemeKodSec.Showmodal;
end else
MKodSecDbGrid.DataSource.DataSet.Refresh;
MalzemeKodSec.Showmodal;
case MalzemeKodSec.modalresult of
mrOK : result := true;
else result := false;
end;
end;
procedure TMalzemeKodSec.Edit1Change(Sender: TObject);
begin
if Edit1.Text <> '' then
begin
with MKodSecDbGrid.DataSource.DataSet do
begin
Filtered := False;
Filter := 'StokKodu='+''''+Edit1.Text+'*''';
Filtered := True;
if Edit1.Text = '' then Filtered := False;
end;
end else MKodSecDbGrid.DataSource.DataSet.Filtered := False;
end;
procedure TMalzemeKodSec.SpeedButton1Click(Sender: TObject);
begin
StokKodSt := DMStox.StokTableStokKodu.AsString;
ModalResult := mrOK;
// (GetParentForm(FormPanel) as TdxPopupEditForm).ClosePopup(True);
end;
procedure TMalzemeKodSec.SpeedButton3Click(Sender: TObject);
begin
ModalResult := mrCancel;
// (GetParentForm(FormPanel) as TdxPopupEditForm).ClosePopup(False);
end;
procedure TMalzemeKodSec.FormActivate(Sender: TObject);
begin
MKodSecDbGrid.DataSource.DataSet.Refresh;
end;
end.
(*
//closes the form containing PopupGrid
procedure TfmPopup.PopupGridDblClick(Sender: TObject);
begin
(GetParentForm(PopupGrid) as TdxPopupEditForm).ClosePopup(True);
end;
procedure TfmPopup.PopupGridKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
if ((Key in [VK_UP, VK_DOWN]) and (ssAlt in Shift)) or
((Key = VK_F4) and not (ssAlt in Shift)) or (Key = VK_ESCAPE) then
(GetParentForm(PopupGrid) as TdxPopupEditForm).ClosePopup(False);
if Key = VK_RETURN then PopupGridDblClick(nil);
end;
procedure TfmPopup.PopupGridMouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
if (Button = mbLeft) and (PopupGrid.GetHitTestInfoAt(X, Y) in RowHitTests) then
PopupGridDblClick(nil);
end;
*)
*****************************
object MalzemeKodSec: TMalzemeKodSec
Left = 403
Top = 507
Width = 724
Height = 275
BorderIcons = []
Caption = 'MalzemeKodSec'
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -10
Font.Name = 'MS Sans Serif'
Font.Style = []
FormStyle = fsStayOnTop
OldCreateOrder = False
OnActivate = FormActivate
PixelsPerInch = 96
TextHeight = 13
object FormPanel: TPanel
Left = 0
Top = 0
Width = 716
Height = 248
Align = alClient
Caption = 'FormPanel'
TabOrder = 0
object ScrollBox1: TScrollBox
Left = 1
Top = 34
Width = 714
Height = 213
Align = alClient
TabOrder = 0
object MKodSecDbGrid: TdxDBGrid
Left = 0
Top = 0
Width = 710
Height = 209
Bands = <
item
end>
DefaultLayout = True
HeaderPanelRowCount = 1
KeyField = 'StokKodu'
ShowGroupPanel = True
SummaryGroups = <>
SummarySeparator = ', '
Align = alClient
ParentShowHint = False
ShowHint = False
TabOrder = 0
DataSource = DMStox.StokDataSource
Filter.Active = True
Filter.AutoDataSetFilter = True
Filter.Criteria = {00000000}
OptionsBehavior = [edgoAutoSearch, edgoAutoSort, edgoDragScroll, edgoEditing, edgoEnterShowEditor, edgoImmediateEditor, edgoTabThrough, edgoVertThrough]
OptionsDB = [edgoCancelOnExit, edgoCanNavigation, edgoConfirmDelete, edgoUseBookmarks]
OptionsView = [edgoBandHeaderWidth, edgoIndicator, edgoUseBitmap]
ShowPreviewGrid = False
object MKodSecDbGridStokKodu: TdxDBGridMaskColumn
Width = 108
BandIndex = 0
RowIndex = 0
FieldName = 'StokKodu'
end
object MKodSecDbGridMalKodu: TdxDBGridMaskColumn
Width = 114
BandIndex = 0
RowIndex = 0
FieldName = 'MalKodu'
end
object MKodSecDbGridMalzemeAd: TdxDBGridColumn
Width = 211
BandIndex = 0
RowIndex = 0
FieldName = 'MalzemeAd'
end
object MKodSecDbGridStokYerAd: TdxDBGridMaskColumn
Width = 108
BandIndex = 0
RowIndex = 0
FieldName = 'StokYerAd'
end
object MKodSecDbGridMiktar: TdxDBGridMaskColumn
Width = 66
BandIndex = 0
RowIndex = 0
FieldName = 'Miktar'
end
object MKodSecDbGridBirimAd: TdxDBGridColumn
Width = 62
BandIndex = 0
RowIndex = 0
FieldName = 'MalzemeBirimi'
end
end
end
object Panel1: TPanel
Left = 1
Top = 1
Width = 714
Height = 33
Align = alTop
Color = 12242402
TabOrder = 1
object Label1: TLabel
Left = 7
Top = 10
Width = 44
Height = 13
Caption = 'Stok Kod'
end
object Edit1: TEdit
Left = 59
Top = 7
Width = 158
Height = 21
Hint = 'Stok Kodlarini filtrelemek icin buraya giriniz..'
ParentShowHint = False
ShowHint = True
TabOrder = 0
OnChange = Edit1Change
end
object Panel2: TPanel
Left = 228
Top = 1
Width = 57
Height = 33
BorderStyle = bsSingle
Color = 8421631
TabOrder = 1
object SpeedButton1: TSpeedButton
Left = 5
Top = 7
Width = 19
Height = 19
Hint = 'Sonucu Tasi'
Glyph.Data = {
76010000424D7601000000000000760000002800000020000000100000000100
04000000000000010000120B0000120B00001000000000000000000000000000
800000800000008080008000000080008000808000007F7F7F00BFBFBF000000
FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00555555555555
555555555555555555555555555555555555555555FF55555555555559055555
55555555577FF5555555555599905555555555557777F5555555555599905555
555555557777FF5555555559999905555555555777777F555555559999990555
5555557777777FF5555557990599905555555777757777F55555790555599055
55557775555777FF5555555555599905555555555557777F5555555555559905
555555555555777FF5555555555559905555555555555777FF55555555555579
05555555555555777FF5555555555557905555555555555777FF555555555555
5990555555555555577755555555555555555555555555555555}
NumGlyphs = 2
ParentShowHint = False
ShowHint = True
OnClick = SpeedButton1Click
end
object SpeedButton3: TSpeedButton
Left = 31
Top = 7
Width = 19
Height = 19
Hint = 'IPTAL/Kapat'
Glyph.Data = {
76010000424D7601000000000000760000002800000020000000100000000100
04000000000000010000130B0000130B00001000000000000000000000000000
800000800000008080008000000080008000808000007F7F7F00BFBFBF000000
FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00333333333333
333333333333333333333333333333333333333FFF33FF333FFF339993370733
999333777FF37FF377733339993000399933333777F777F77733333399970799
93333333777F7377733333333999399933333333377737773333333333990993
3333333333737F73333333333331013333333333333777FF3333333333910193
333333333337773FF3333333399000993333333337377737FF33333399900099
93333333773777377FF333399930003999333337773777F777FF339993370733
9993337773337333777333333333333333333333333333333333333333333333
3333333333333333333333333333333333333333333333333333}
NumGlyphs = 2
ParentShowHint = False
ShowHint = True
OnClick = SpeedButton3Click
end
end
end
end
end
**************
ve sonrakide DFM dosya
Bu sebeple forum sahası kod aktarımında kullanılabilir.