Navigacija
Lista poslednjih: 16, 32, 64, 128 poruka.

Numerička tačka

[es] :: Pascal / Delphi / Kylix :: Numerička tačka

[ Pregleda: 4275 | Odgovora: 12 ] > FB > Twit

Postavi temu Odgovori

Autor

Pretraga teme: Traži
Markiranje Štampanje RSS

edin_jak

Član broj: 45093
Poruke: 33
*.ADSL.neobee.net.



Profil

icon Numerička tačka29.01.2006. u 05:35 - pre 221 meseci
Kako da u celoj aplikaciji na numeričkoj tastaturi decimalnu tačku zamenim sa decimalnim zarezom
 
Odgovor na temu

obucina

Član broj: 38191
Poruke: 723

Jabber: obucina


+7 Profil

icon Re: Numerička tačka29.01.2006. u 08:34 - pre 221 meseci
DecimalSeparator := ',';

 
Odgovor na temu

edin_jak

Član broj: 45093
Poruke: 33
*.ADSL.neobee.net.



Profil

icon Re: Numerička tačka29.01.2006. u 09:05 - pre 221 meseci
Nasao sam resenje koje ujedno omogucava Dos-ovski nacin rada u Windowsu


procedure TForm1.FormCreate(Sender: TObject);
begin
Application.OnMessage := ApplicationMessage;
end;

procedure TForm1.ApplicationMessage(var Msg: TMsg;


var Handled: Boolean);


var


ActiveControl : TWinControl;


Form : TCustomForm;


ShiftState : TShiftState;


KeyState : TKeyboardState;


begin


case Msg.Message of


WM_KEYDOWN, WM_KEYUP:


case Msg.wParam of


VK_RETURN:


// Replaces ENTER with TAB, and CTRL+ENTER with ENTER...


begin


GetKeyboardState(KeyState);


ShiftState := KeyboardStateToShiftState(KeyState);


if (ShiftState = []) or (ShiftState = [ssCtrl]) then begin


ActiveControl := Screen.ActiveControl;


if (TCustomComboBox(ActiveControl) is TCustomComboBox) and


(TCustomComboBox(ActiveControl).DroppedDown) then begin


if ShiftState = [ssCtrl] then begin


KeyState[VK_LCONTROL] := KeyState[VK_LCONTROL] and $7F;


KeyState[VK_RCONTROL] := KeyState[VK_RCONTROL] and $7F;


KeyState[VK_CONTROL] := KeyState[VK_CONTROL] and $7F;


SetKeyboardState(KeyState);


end;


end else if (TCustomEdit(ActiveControl) is TCustomEdit)


and not (TCustomMemo(ActiveControl) is TCustomMemo)


or (TCustomCheckbox(ActiveControl) is TCustomCheckbox)


or (TRadioButton(ActiveControl) is TRadioButton)


or (TCustomListBox(ActiveControl) is TCustomListBox)


or (TCustomComboBox(ActiveControl) is TCustomComboBox)


// You can add more controls to the list with "or"


then


if ShiftState = [] then begin


Msg.wParam := VK_TAB


end else begin // ShiftState = [ssCtrl]


Msg.wParam := 0; // Discard the key


if Msg.Message = WM_KEYDOWN then begin


Form := GetParentForm(ActiveControl);


if (Form <> nil) and


(ActiveControl.Perform(CM_WANTSPECIALKEY,


VK_RETURN, 0) = 0) and


(ActiveControl.Perform(WM_GETDLGCODE, 0, 0)


and DLGC_WANTALLKEYS = 0) then


begin


KeyState[VK_LCONTROL] := KeyState[VK_LCONTROL] and $7F;


KeyState[VK_RCONTROL] := KeyState[VK_RCONTROL] and $7F;


KeyState[VK_CONTROL] := KeyState[VK_CONTROL] and $7F;


SetKeyboardState(KeyState);


Form.Perform(CM_DIALOGKEY, VK_RETURN, Msg.lParam);


end;


end;


end;


end;


end;


VK_DOWN:


begin


GetKeyboardState(KeyState);


if KeyboardStateToShiftState(KeyState) = [] then begin


ActiveControl := Screen.ActiveControl;


if (TCustomEdit(ActiveControl) is TCustomEdit)


and not (TCustomMemo(ActiveControl) is TCustomMemo)


// You can add more controls to the list with "or"


then


Msg.wParam := VK_TAB;


end;


end;


VK_UP:


begin


GetKeyboardState(KeyState);


if KeyboardStateToShiftState(KeyState) = [] then begin


ActiveControl := Screen.ActiveControl;


if (TCustomEdit(ActiveControl) is TCustomEdit)


and not (TCustomMemo(ActiveControl) is TCustomMemo)


// You can add more controls to the list with "or"


then


begin


Msg.wParam := 0; // Discard the key


if Msg.Message = WM_KEYDOWN then begin


Form := GetParentForm(ActiveControl);


if Form <> nil then // Move to previous control


Form.Perform(WM_NEXTDLGCTL, 1, 0);


end;


end;


end;


end;


// Replace the decimal point of the numeric key pad (VK_DECIMAL)


// with a comma (key code = 188). For Spanish applications.


VK_DECIMAL:


begin


GetKeyboardState(KeyState);


if KeyboardStateToShiftState(KeyState) = [] then begin


Msg.wParam := 188;


end;


end;


end;


end;


end;
 
Odgovor na temu

obucina

Član broj: 38191
Poruke: 723

Jabber: obucina


+7 Profil

icon Re: Numerička tačka29.01.2006. u 12:38 - pre 221 meseci
Citat:
edin_jak: Nasao sam resenje koje ujedno omogucava Dos-ovski nacin rada u Windowsu

Zaista mi nije jasno zašto programeri ne shvate da je DOS MRTAV? DOS način rada je za DOS. Windows ima novi način rada i treba ga primenjivati. Pa jesi li DOS ili Windows programer...
 
Odgovor na temu

dekys
Dejan Stevanović

Član broj: 464
Poruke: 104



+1 Profil

icon Re: Numerička tačka29.01.2006. u 12:44 - pre 221 meseci
Ne radi se o tome jeli covek Djokista ili Mikista ili je od Erriksonovih ili nokijinih vec o tome hoce li njegov softver zaziveti ili ne.

Imate pregtst softvera napisanog u dosu i veli broj ljudi koji su se na taj nacin rada navikli. Piritisne na enter ono ide na sledeci tab ako im to ne ispostujes njima je tvoj program neprihvatljiv.

I sam imam takvu situaciju sada.... jednostavno knjigovodje hoce da im bude kako su naucili...


AKO NECE BREG MUHAMEDU....
 
Odgovor na temu

Nemanja Avramović
Engineering Manager
MENU Technologies
Beograd, Srbija

Član broj: 32202
Poruke: 4391
195.252.99.*

Sajt: https://avramovic.info


+46 Profil

icon Re: Numerička tačka29.01.2006. u 13:17 - pre 221 meseci
offtopic: koristi code tagove kad postavljas kod
Laravel Srbija.

[NE PRUŽAM PODRŠKU ZA PHP PREKO PRIVATNIH PORUKA!]
 
Odgovor na temu

obucina

Član broj: 38191
Poruke: 723

Jabber: obucina


+7 Profil

icon Re: Numerička tačka30.01.2006. u 13:37 - pre 221 meseci
Citat:
dekys:I sam imam takvu situaciju sada.... jednostavno knjigovodje hoce da im bude kako su naucili...

Stoji, ali valjda ima malo i do volje da nametnes ono sto je ispravno i ne prihvatis svaku tupavu zelju korisnika. Da vidis kako moji radosno lupaju po TAB-u...

Pre nego neko pocne - ne zelim da se raspravljam o tome da li treba i kako treba, da li se korisniku treba uvlaciti, tetositi ga i ispunjavati i njegovu najgluplju zelju ili se drzati standarda. Ja ih teram da promene nacin rada i kraj. Ja sam programer i ja znam sta i kako treba a ne on. Ako nece mene, neka nadje drugog programera.
 
Odgovor na temu

sojic
Dalibor Sojic
Makedonija

Član broj: 7051
Poruke: 796
62.162.219.*

Sajt: right-sock.net


+1 Profil

icon Re: Numerička tačka30.01.2006. u 16:09 - pre 221 meseci
Kako da pročitam decimalni separator, valutu... od Regional Settings?
routing protocols enable routers to route routed protocols!
 
Odgovor na temu

edin_jak

Član broj: 45093
Poruke: 33
*.ADSL.neobee.net.



Profil

icon Re: Numerička tačka30.01.2006. u 20:38 - pre 221 meseci
Evo situacije zbog čega mi treba DOS-ovski način rada. Preko 100 firmi u gradu koristi softver napisan u clliper-u, uglavnom su svi stariji knjigovođe koji osim tog programa ne znaju ništa drugo da koriste na računaru. Čik sve njih kao zapovedni programer nateraj da koriste tab umesto entera i pri tom im dobro naplati usluge.
 
Odgovor na temu

delalt

Član broj: 68360
Poruke: 198
81.93.74.*



Profil

icon Re: Numerička tačka30.01.2006. u 21:24 - pre 221 meseci
Hm, nisu knjigovođe baš za sve krive,
realno gledajući, tab tipka je jedna i obično nepotrebno zauzima i
lijevu ruku, dok se enter može koristiti i uz slovni i uz numerički dio tastature
(ovo zadnje posebno). Kad se koristi samo enter, i većinom unose cifre,
onda je moguće osloboditi lijevu ruku i dobija se na brzini.
Drugi slučaj - registar kase, lijeva ruka se obično koristi za bar kod a desna za
unos i prihvatanje (sa enter).

Evo za separator i ostalo:

Code:
 
uses
 SysUtils;
var 
  loc: TFormatSettings;
  s1, s2: String;
begin
  GetLocaleFormatSettings(LOCALE_SYSTEM_DEFAULT, loc);
  s1 := loc.DecimalSeparator;
  s2 := loc.CurrencyString;
// .......
end;

 
Odgovor na temu

martinj
Martin Jeremic
Nis

Član broj: 39299
Poruke: 86
*.smin.sezampro.yu.

Sajt: www.onedevteam.com


+2 Profil

icon Re: Numerička tačka02.02.2006. u 06:27 - pre 221 meseci
Recimo da imas Edit1 i Edit2 i iz edit1 trebas da predjes u edit2 pritiskom na enter.
Samo postavis u onKeyDown event edit1 kontrole

Code:

if Key = VK_ENTER then Edit2.SetFocus;


i eto ti enter umesto tab....
 
Odgovor na temu

Nemanja Avramović
Engineering Manager
MENU Technologies
Beograd, Srbija

Član broj: 32202
Poruke: 4391
195.252.99.*

Sajt: https://avramovic.info


+46 Profil

icon Re: Numerička tačka02.02.2006. u 12:34 - pre 221 meseci
A sta ako ima jako mnogo edit-a? :)
Laravel Srbija.

[NE PRUŽAM PODRŠKU ZA PHP PREKO PRIVATNIH PORUKA!]
 
Odgovor na temu

mzarko

Član broj: 33636
Poruke: 80
*.bisinter.net.



Profil

icon Re: Numerička tačka03.02.2006. u 16:00 - pre 221 meseci
procedure TForm1.FormKeyPress(Sender: TObject; var Key: Char);
begin
if Key = #13 then
begin
Key := #0;
if GetKeyState(VK_Shift) and $8000 <> 0 then
PostMessage(Handle, WM_NEXTDLGCTL, 1, 0)
else
PostMessage(Handle, WM_NEXTDLGCTL, 0, 0);
end;

end;

Takodje i KeyPreview na Formi postavi na True.
 
Odgovor na temu

[es] :: Pascal / Delphi / Kylix :: Numerička tačka

[ Pregleda: 4275 | Odgovora: 12 ] > FB > Twit

Postavi temu Odgovori

Navigacija
Lista poslednjih: 16, 32, 64, 128 poruka.