這是李維所教的小撇步,果然有些眉眉角角要注意!
如果單純使用ListBox元件的話,畫面設定好像這樣。
不過在調整ListBox二個屬性後,就山寨的更像了喔!
1. GroupingKind 改成 gsGrouped
2. Stylelookup 改成 transparentlistboxstyle
大型網站架構..net 架構師.rabbitMQ.redis.行動開發.APP開發教學.PHP Laravel開發..net core C# 開發.架構師之路.Delphi開發.資料庫程式.進銷存.餐飲POS系統
打開Eclipse出現以下訊息~
The Android SDK requires Android Developer Toolkit version 21.1.0 or above.
Current version is 21.0.1.2012-12-6-2-58.
Please update ADT to the latest version.
接著還出現 ”installing software has encountered a problem”
解決方式:
Window → Preferences → Install/Update → Available Software Sites
點選 adt 按 edit
將http://dl-ssl.google.com/android/eclipse/
改成 https://dl-ssl.google.com/android/eclipse/
Google在Google I/O 2013 發表了全新的開發平台 Android Studio ,可以讓開發者在更改內容同時,就能預覽,提高了開發的速度。
Android Studio 網址: http://developer.android.com/sdk/installing/studio.html
在上一篇文章中,筆者教大家如何在Mac系統中配置PAServer了,接下來要教大家如何設計可以同時執行在Windows及Mac OS的程式。
一、File→New選取FireMonkey Desktop Application
二、接下來選擇一般的HD FireMonkey Application
三、新增專案後,在專案的Target Platform按右鍵,選擇Add Platform
四、接著選擇OS X後按ok
五、接著在OS X按右鍵 Assign Remote Profile 設置OS X的編譯環境
六、Profile name填上你要的名字
七、Host name填上你在上一篇文章設置的MAC OS主機位置,password則設置上篇文章所設定的密碼。
八、按 Test Connection測試是否可以連得上(記得要執行paserver)
九、如果順利的話,按下Finish就大功告成!
九、接著點選剛才建立的Platform名稱按OK!
十一、如果設定沒錯的話,在XE3按下執行後,程式就會直接執行在Mac OS的畫面上囉!
1.安裝PAServer
將 \Program Files\Embarcadero\RAD Studio\10.0\PAServer中的setup_paserver.zip 複製到 Mac OSX系统
2.將setup_paserver.zip解壓縮進行安裝。
3.安裝完後,進行環境配置
\user\XXXX\Applications\Embarcadero\RADPAServer\10.0\,執行paserver
4.執行後,paserver會請您設定密碼,設定完後就配置ok!
5.利用文字編輯程式打開目錄下的 paserver.command,在第二行後面加上-password=xxxx,xxxx是你在上一步驟設定的密碼。儲存後關閉!
6.幫 paserver.command建立捷徑(替身),或是利用「系統偏好設定」→「帳號」→「登入項目」讓它隨系統啟動。
[php]
#lat1,lon1是第一個點的經緯度
#lat2,lon2是第二個點的經緯度
#unit的話就用"K" (這樣的話傳回值就會是公尺)
function distance($lat1, $lon1, $lat2, $lon2, $unit) {
global $source;
$theta = $lon1 – $lon2;
$dist = sin(deg2rad($lat1)) * sin(deg2rad($lat2)) +cos(deg2rad($lat1)) * cos(deg2rad($lat2)) * cos(deg2rad($theta));
$dist = acos($dist);
$dist = rad2deg($dist);
$miles = $dist * 60 * 1.1515;
$unit = strtoupper($unit);
if ($unit == "K") {
$meters = intval($miles * 1.609344 * 1000);
if($meters > 10000){
return intval($meters/1000).msg(‘公里’,’km’);
}else{
return $meters.msg(‘公尺’,’m’);
}
} else if ($unit == "N") {
return ($miles * 0.8684);
} else {
return $miles;
}
}
[/php]
您是鐵道迷嗎?自認對台灣鐵路瞭若指掌嗎?那您可以來玩玩這款「台灣鐵路通Taiwan Railway」遊戲。
設計師魏巍 一手包辦了遊戲中的圖片、程式及音效,連宣傳影片都是自己拍攝的,可見對於APP的用心程度。
遊戲的玩法也相當簡單,在畫面中會出現現在地及目的地二個提示。然後以手指拖拉列車往正確的方向即可!
所以遊戲的前提是,您要自認熟悉各個站名的先後順序,或是在遊戲中有相關的資訊供參考。
下載網址:
iOS: https://itunes.apple.com/tw/app/id624473652?mt=8
Android: https://play.google.com/store/apps/details?id=com.appsgaga.game.taiwanrailway
以前在撰寫程式時,最討厭的就是醜醜的外觀,如果不是自己畫,就是得找第三方元件(像BusinessSkinForm)來解決。
自從Delphi XE2就開始有的功能,跟大家分享一下如何讓程式看起來不再這麼醜。
1.靜態更改
.Project→Options開啟Project Options選項,在Application→Appearance的Custom Styles就是可以更改介面的選項
.如果不清楚長什麼樣子時,可以點選任一名稱反白後,再點旁邊的Preview就可以預覽
.勾選要變成的Style後,再到Default Style下拉你要的Style按OK即可。
2.動態程式更改
.依照靜態更改方式,勾選你想要呈現的STYLE。
.增加 uses Vcl.Themes
[delphi]
uses Vcl.Themes;
[/delphi]
.讀入風格檔
[delphi]
procedure TForm1.Button1Click(Sender: TObject);
Var
StyleName : string;
begin
ListBox1.Items.Clear;
for StyleName in TStyleManager.StyleNames do
if ListBox1.Items.IndexOf(Name)=-1 then
ListBox1.Items.Add(StyleName);
end;
[/delphi]
.設定風格檔
[delphi]
procedure TForm1.Button2Click(Sender: TObject);
begin
if ListBox1.ItemIndex>=0 then
TStyleManager.SetStyle(ListBox1.Items[ListBox1.ItemIndex]);;
end;
[/delphi]
範例程式下載 GitHub https://github.com/superlevin/DelphiXE3_SetStyle
3.自製風格.Tools→Bitmap Style Designer
預設的Style檔案位置在:C:\Users\Public\Documents\RAD Studio\10.0\Styles
[delphi]
uses Winapi.Windows;
procedure TMainForm.Button1Click(Sender: TObject);
var
ScreenHorizontal :integer;
ScreenVertical:integer;
begin
ScreenPixelX:= GetDeviceCaps(GetDC(Application.Handle),HORZRES); // Horizontal width in pixels
ScreenPixelY:= GetDeviceCaps(GetDC(Application.Handle),VERTRES); // Vertical height in pixels
// 取得螢幕解析度
ShowMessage(IntToStr(ScreenHorizontal)+’ X ‘+ IntToStr(ScreenVertical));
end;
[/delphi]